opencode
opencode copied to clipboard
Model selection not applied after restart - config shows Opus 4.5 but Sonnet 4 is used
Description
After changing the model to Claude Opus 4.5 via /models command and restarting OpenCode, the session still uses Claude Sonnet 4 despite:
- The config file correctly showing the new model
- The TUI footer displaying "Claude Opus 4.5 (latest)"
- Multiple full restarts of OpenCode
When asking the model "what model are you", it consistently responds with "Claude Sonnet 4 (claude-sonnet-4-20250514)".
Steps to Reproduce
- Run
/modelsand selectanthropic/claude-opus-4-5-20251101 - OpenCode shows: "The model change to Opus 4.5 was saved to your config..."
- Verify
opencode.jsonccontains:"model": "anthropic/claude-opus-4-5-20251101" - Fully exit and restart OpenCode
- Start a new session
- Ask "what model are you"
- Model responds it is Claude Sonnet 4, not Opus 4.5
Expected Behavior
After restart, the new session should use Claude Opus 4.5 as configured.
Actual Behavior
- TUI footer shows "Claude Opus 4.5 (latest) Anthropic" (correct)
- Actual model responding is Claude Sonnet 4 (incorrect)
Configuration
{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-opus-4-5-20251101",
// ... rest of config
}
Environment
- Platform: macOS (darwin)
- OpenCode caller: vscode
- No model-related environment variable overrides present
Screenshots
The TUI clearly shows the discrepancy - footer says Opus 4.5 but model self-identifies as Sonnet 4.
Additional Context
This may be a caching issue or the model parameter not being correctly passed to the Anthropic API. The fallback to Sonnet 4 happens silently with no error messages.