Skip to content

Web UI model dropdown resets to config default when switching sessions #33402

Description

@Cothek

Description

Description:

When using the web UI with multiple chat sessions, switching between sessions in the sidebar resets the model dropdown to the config default instead of showing the target session's stored model.

Steps to reproduce:

  1. Start a new session in the web UI
  2. Change the model via the dropdown (e.g., from your default to a different model)
  3. Send a message (model persists correctly at this point - confirmed in DB)
  4. Click a different session in the sidebar to switch to it
  5. The model dropdown resets to whatever model is set in your opencode.json config default

Expected behavior:

Switching to an existing session should load that session's stored model into the dropdown. Each session has its own model column in the database (stores {"id":"model-id","providerID":"provider","variant":"variant"}), and the dropdown should reflect that stored value.

Actual behavior:

The dropdown always initializes from the config default on session switch, ignoring the per-session model stored in the database.

Database evidence:

The session table has a model column. Each session stores its own model selection. For example, session A might store {"id":"mimo-v2.5-free","providerID":"opencode","variant":"high"} while the config default is opencode-go/deepseek-v4-flash. The backend correctly persists the model during message send, and the stored value survives across page refreshes. The bug is only triggered on session switch.

Related issues:

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions