Repository navigation
Description
Summary
Switching agents in an existing TUI session can silently change its model to one selected in another session. Returning to the original session initially shows its original model, so the unexpected change only becomes visible after switching agents and is easy to miss before submitting a prompt.
Environment
- opencode version: v2.2.6
- OS: macOS / Darwin 25.6.0, arm64
- Terminal: Ghostty (
TERM=xterm-256color,COLORTERM=truecolor) - Shell: zsh
- Install/channel: Version reports v2.2.6 without a prerelease suffix; installation method not collected.
- Active plugins: No explicit plugin entries in the inspected global config. Local plugin file present:
~/.config/opencode/plugins/deepseek-search.ts; runtime activation not verified. Project-specific configuration at the original reproduction location has not been inspected.
Reproduction
- Run
opencodein a directory to open the TUI. In the original session (A), the input composer showsdeepseek-flash. - Click the + button at the top to create a new session (B).
- In session B, select
gpt-6-astra. - Return to session A. Its composer still shows
deepseek-flash, as expected. - Switch from Build to Plan in session A.
- Observe that session A's composer now shows
gpt-6-astra, despite not explicitly selecting that model in session A.
Expected Behavior
Selecting a model in session B should not implicitly determine the model used when switching agents in session A.
Explicit agent-specific model configurations or selections can be respected, but an agent without such a selection should keep the current session's model rather than silently inherit the most recently selected model from another session.
Actual Behavior
Session A initially retains deepseek-flash when revisited, but switching agents changes the displayed model to gpt-6-astra, which was selected in session B. This makes model selection within an existing session unpredictable across agent switches.
Additional Context
- The original observation concerns the model displayed in the composer. The model actually sent to the provider has not been independently traced.
- Impact: a user who does not notice the change can submit the next prompt to an unintended model. Different agents in an older session may consequently use unexpected models, affecting cost, capabilities, and potentially provider routing.
- The agent switch was Build → Plan. Repetition frequency and whether either session had submitted messages before these steps have not yet been recorded.
- No workaround has been tested for this report.
- Closely related: [FEATURE]: keep the tab's model when switching between plan and build #54375, especially the comments describing a model chosen in tab B being picked up only after switching agents in tab A. This report highlights that cross-session interaction, rather than requesting removal of intentional per-agent model memory.
- Related tab-selection issue: tui: tab model selection follows other tabs and clients #54363 and proposed fix fix(tui): keep model selection owned by the tab #54367. A comment on [FEATURE]: keep the tab's model when switching between plan and build #54375 explicitly notes that fix(tui): keep model selection owned by the tab #54367 does not address the agent-switch fallback case.
Activity
opencodejr commentedon Nov 10, 2026
Thanks for the detailed write-up and repro steps!
I think this is a duplicate of #54375. Its discussion covers this exact case: an agent you haven't used yet in the current session falls back to the model picked most recently in any tab. That's how Plan in session A picks up the model you chose in session B. A contributor reproduced it there on
dev, and the reference branch linked in that issue keeps the tab's own model when you switch agents.Possible duplicates and related issues, ordered from most to least likely:
If you add a 👍 or your scenario to #54375, that helps maintainers see how many people this affects. The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
Woo-kk commentedon Nov 10, 2026
Thanks for pointing me to #54375. I read through it and can confirm that I’m seeing the same issue. I’m closing this as a duplicate.
opencodejr commentedon Nov 10, 2026
Thanks for checking and confirming! A 👍 or a short note about your session A / session B case on #54375 helps maintainers see how many people this affects.