You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tui: tab model selection follows other tabs and clients #54363
Model preferences are synced across clients since #49611. A tab without its own selection resolves its model from the shared recent list, and its variant from the shared per-model preferences, and keeps following them live. A model or variant picked in another tab or TUI instance therefore changes what an open tab will use, and a new tab opened from a session starts from whatever was picked last anywhere instead of the session it was opened from.
Plugins
No response
OpenCode version
2.0.26 (also current v2)
Steps to reproduce
Run two TUI instances, A and B. In A, open a new session tab and do not pick a model. In B, pick a different model. A's footer switches to B's model.
In one instance, open a session in tab 1 and pick model X with variant high. Switch to tab 2 and pick model Y. Back in tab 1, open a new tab with "+": it starts with Y instead of X / high. With /new it keeps X, but the variant follows the one last set for X anywhere.
Thanks for the clear report. I reproduced the first scenario on 2.0.26, and it still happens on the latest dev (7b3d4ce).
Steps (simulated provider with two models and no model set in the config):
Open TUI A on a new-session screen without picking a model. Its footer shows the first model.
In a second TUI B, pick the other model via /models.
A's footer switches to B's model even though nothing was done in A.
The recording and screenshots below show instance A before and after B picks a model, and the script below reproduces it. I did not automate the second scenario ("+" and /new tabs inside one instance), but the code that causes the first problem looks like it causes that one too.
Related: #49611 (the change that syncs model preferences across clients).
recording.mp4
Reproduction script (drive.ts)
// Repro for anomalyco/opencode#54363: a new-session tab with no own model follows a// model picked in another TUI instance (shared "recent" model preferences).import{Effect}from"effect"import{OpenCodeDriver}from"opencode-drive"exportdefaultOpenCodeDriver.use({
...(process.env.OC_DEV ? {opencode: {dev: process.env.OC_DEV}} : {}),tui: {recording: true,keypressOverlay: true},setup: ({ config })=>Effect.sync(()=>{constc=configasanydeletec.model// no configured default: the tab falls back to recent modelsc.providers.simulation.models["gpt-sim-second"]={name: "Second Model",capabilities: {tools: true,input: ["text"],output: ["text"]},limit: {context: 128_000,output: 16_000},}}),},(oc)=>Effect.gen(function*(){consta=oc.uiyield*a.waitFor("Simulated Model")yield*a.screenshot("A-before")constb=yield*oc.tuis.launch({viewport: {cols: 100,rows: 40}})yield*b.ui.waitFor("Simulated Model")// In instance B, pick the other modelyield*b.ui.submit("/models")yield*b.ui.waitFor("Select model")yield*b.ui.type("Second")yield*Effect.sleep(500)yield*b.ui.enter()yield*b.ui.waitFor("Second Model")yield*b.ui.screenshot("B-after-pick")// A never picked a model, yet its footer switches to B's choiceyield*a.waitFor("Second Model",{timeout: 10_000})yield*Effect.sleep(1000)yield*a.screenshot("A-after")}),)
Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.
I'm seeing this too. I'm on OpenCode 2.0.29 on macOS, installed from the Homebrew tap anomalyco/tap/opencode-v2. I upgraded from V1 to V2 this week. I run several TUI windows at the same time, each on a different model on purpose. In V1 every window was its own process, so each one kept its own model.
On V2, I opened a few windows, changed the model in one, and the others switched to it without me touching them, which is scenario 1 above. I'd like each window to stay on the model it shows. That could mean treating it as that window's own choice, or adding a setting to turn off live model sync between clients.
Thanks for confirming on 2.0.29. Windows still on the new-session screen with no model picked in them follow the most recent pick from any window; #54367 should fix that by keeping the model each window resolved when it loaded. A window with a session already running keeps that session's model, except when you switch between plan and build and the agent you switch to has no model of its own; that case is tracked in #54375.
Did a window with a running session switch too, without a plan/build switch? That would be a different bug.
Syncing model preferences across clients is intentional (#49611), so a switch to turn it off would be a separate request for the maintainers; keeping each window on its own model is what #54367 aims for without one.
Activity
opencode-agent commentedon Oct 10, 2026
Thanks for the clear report. I reproduced the first scenario on 2.0.26, and it still happens on the latest
dev(7b3d4ce).Steps (simulated provider with two models and no
modelset in the config):/models.The recording and screenshots below show instance A before and after B picks a model, and the script below reproduces it. I did not automate the second scenario ("+" and
/newtabs inside one instance), but the code that causes the first problem looks like it causes that one too.Related: #49611 (the change that syncs model preferences across clients).
recording.mp4
Reproduction script (drive.ts)
Run it with opencode-drive:
opencode-drive run ./drive.ts. It drivesopencodefrom yourPATH; setOC_DEVto the path of an OpenCode checkout to run that from source instead.arashbehmand commentedon Oct 15, 2026
I'm seeing this too. I'm on OpenCode 2.0.29 on macOS, installed from the Homebrew tap
anomalyco/tap/opencode-v2. I upgraded from V1 to V2 this week. I run several TUI windows at the same time, each on a different model on purpose. In V1 every window was its own process, so each one kept its own model.On V2, I opened a few windows, changed the model in one, and the others switched to it without me touching them, which is scenario 1 above. I'd like each window to stay on the model it shows. That could mean treating it as that window's own choice, or adding a setting to turn off live model sync between clients.
cleardevice commentedon Oct 15, 2026
Thanks for confirming on 2.0.29. Windows still on the new-session screen with no model picked in them follow the most recent pick from any window; #54367 should fix that by keeping the model each window resolved when it loaded. A window with a session already running keeps that session's model, except when you switch between plan and build and the agent you switch to has no
modelof its own; that case is tracked in #54375.Did a window with a running session switch too, without a plan/build switch? That would be a different bug.
Syncing model preferences across clients is intentional (#49611), so a switch to turn it off would be a separate request for the maintainers; keeping each window on its own model is what #54367 aims for without one.