Skip to content

fix(tui): drop a fusion leg's model pin when the leg moves to another provider - #620

Open
sosidudku1 wants to merge 2 commits into
mainfrom
fix/run-mode-repin-drops-model-label
Open

sosidudku1 wants to merge 2 commits into
mainfrom
fix/run-mode-repin-drops-model-label

Conversation

@sosidudku1

@sosidudku1 sosidudku1 commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

What

Re-applying fusion with a different orchestrator or worker provider (setRunModeInConfig, the TUI run-mode switch) merged the new provider pin over the stored fusion block but kept the stored orchestratorModel / workerModel. Those pins name a model of the previous provider, so the new leg was displayed and priced as the old model.

setRunModeInConfig now drops a leg's model pin when that leg moves to a different provider, unless the same change sets a new model pin. Re-applying the same provider keeps the pin; the other leg's pin is untouched. A model pin on a leg that was never pinned to a provider is left alone, the same rule #597 uses for removal.

Sibling of #597 (which does the same when a provider is removed). The two touch different files and do not conflict.

Tests

  • src/tui/persist-run-mode.test.ts: five new cases. Two reproduce the bug and fail on main (both legs move, only one leg moves); three guard the cases that must not change (legs re-applied unchanged, model pin on a leg with no provider pin, new pin comes with the move).
  • npm run lint clean; npx vitest run src/tui/persist-run-mode.test.ts src/tui/run-mode src/config/llm-run-mode-config.test.ts: 70/70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant