opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Model selection not applied after restart - config shows Opus 4.5 but Sonnet 4 is used

Open JulianMason opened this issue 3 days ago • 1 comments

Description

After changing the model to Claude Opus 4.5 via /models command and restarting OpenCode, the session still uses Claude Sonnet 4 despite:

  1. The config file correctly showing the new model
  2. The TUI footer displaying "Claude Opus 4.5 (latest)"
  3. 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

  1. Run /models and select anthropic/claude-opus-4-5-20251101
  2. OpenCode shows: "The model change to Opus 4.5 was saved to your config..."
  3. Verify opencode.jsonc contains: "model": "anthropic/claude-opus-4-5-20251101"
  4. Fully exit and restart OpenCode
  5. Start a new session
  6. Ask "what model are you"
  7. 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.

JulianMason avatar Jan 09 '26 10:01 JulianMason