Bug
The agent.model config override in opencode.jsonc does not take effect for built-in subagents (general, explore). They inherit the primary model regardless of the configured override.
Reproduction
- Set the primary model to Opus 4 (
claude-opus-4-6)
- Add the following to
opencode.jsonc:
"agent": {
"general": {
"model": "anthropic/claude-sonnet-4-20250514"
},
"explore": {
"model": "anthropic/claude-sonnet-4-20250514"
}
}
- Start a new OpenCode session (confirmed config is loaded at session start)
- Invoke a Task tool that uses the
explore subagent
- Query the local API:
GET /session/{subagent-session-id}/message
Expected
The subagent assistant message shows "modelID": "claude-sonnet-4-20250514"
Actual
The subagent assistant message shows "modelID": "claude-opus-4-6" -- the primary model, not the configured override.
API response excerpt:
{
"modelID": "claude-opus-4-6",
"providerID": "anthropic",
"cost": 0.084715,
"tokens": { "total": 13492, "input": 3, "output": 21, "cache": { "write": 13468, "read": 0 } }
}
The cost ($0.085 for ~13.5k tokens) confirms Opus pricing, not Sonnet.
Verification
- Config syntax is correct (matches docs examples exactly)
- Config parses successfully (validated with PowerShell JSON parser)
- This is a fresh session (not a mid-session config change)
- The
small_model config in the same file does work
Environment
- OpenCode v1.4.3
- Windows 11
- Provider: Anthropic (direct)
- Primary model:
claude-opus-4-6
Docs reference
https://opencode.ai/docs/agents#model shows this should work:
{
"agent": {
"plan": {
"model": "anthropic/claude-haiku-4-20250514"
}
}
}
Bug
The
agent.modelconfig override inopencode.jsoncdoes not take effect for built-in subagents (general,explore). They inherit the primary model regardless of the configured override.Reproduction
claude-opus-4-6)opencode.jsonc:exploresubagentGET /session/{subagent-session-id}/messageExpected
The subagent assistant message shows
"modelID": "claude-sonnet-4-20250514"Actual
The subagent assistant message shows
"modelID": "claude-opus-4-6"-- the primary model, not the configured override.API response excerpt:
{ "modelID": "claude-opus-4-6", "providerID": "anthropic", "cost": 0.084715, "tokens": { "total": 13492, "input": 3, "output": 21, "cache": { "write": 13468, "read": 0 } } }The cost ($0.085 for ~13.5k tokens) confirms Opus pricing, not Sonnet.
Verification
small_modelconfig in the same file does workEnvironment
claude-opus-4-6Docs reference
https://opencode.ai/docs/agents#model shows this should work:
{ "agent": { "plan": { "model": "anthropic/claude-haiku-4-20250514" } } }