Skip to content

Model selection in UI is ignored - reverts to default model instead #9824

@ebreen

Description

@ebreen

Bug Description

When selecting a model in the OpenCode UI model selector, the selection is ignored when submitting a prompt. The system reverts to using a default model instead of the user-selected model.

Expected Behavior

User selects a model in the UI → Submit prompt → System uses the selected model

Actual Behavior

User selects a model in the UI → Submit prompt → System ignores selection and uses default model (e.g., Gemini 3 Pro Preview)

Steps to Reproduce

  1. Open OpenCode in a directory with existing auth credentials for multiple providers
  2. Open the model selector (Ctrl+O or via UI)
  3. Select a different model than the default
  4. Submit a prompt
  5. Observe that the system uses a different model than selected

Environment

  • OS: macOS (darwin)
  • OpenCode version: Latest (as of 2026-01-21)
  • Providers configured: anthropic (oauth), google (oauth), zai-coding-plan (api)

Troubleshooting Already Done

1. Plugin interference testing

  • Disabled oh-my-opencode plugin → Issue persists
  • Disabled opencode-antigravity-auth plugin → Issue persists
  • Result: Issue is in OpenCode core, not plugins

2. Log analysis

Logs show the system auto-selecting models:

3. Configuration files checked

  • ~/.config/opencode/opencode.json - No global model set
  • ~/.local/share/opencode/auth.json - Auth credentials present
  • ~/.config/opencode/oh-my-opencode.json - Has agent configs
  • No config.json in ~/.local/share/opencode/

4. Environment

  • No OPENCODE_MODEL env var set
  • No model-specific env vars that would override

What Should Happen

The model selected in the UI should be respected and used for the session.

Additional Notes

  • The issue occurs consistently across sessions
  • Both primary providers (anthropic, google) show this behavior
  • This appears to be a regression or design flaw in how OpenCode handles model selection persistence

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