You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Subagent spawned via Task tool without its own variant inherits parent's variant concatenated onto model ID (model#variant), causing "Model not found" errors #50698
Description (the bug description + error, same as before):
When a subagent is spawned via the Task tool and the target agent has no variant of its own defined, it appears to inherit the parent session's active variant — but instead of applying it as a separate parameter (as the config schema and task.ts both do correctly), something downstream joins it onto the model ID as a single #-delimited string before the request reaches the provider.
Our agent's model field is a clean "litellm/" — no # suffix anywhere in our own config. specs/v2/config.md explicitly documents model and variant as separate fields specifically to avoid ambiguity, since model IDs can contain slash-delimited segments. The SessionModel schema ({ id, providerID, variant: optional(Schema.String) }) and task.ts (const variant = msg.info.variant; const model = next.model ?? { modelID: msg.info.modelID, providerID: msg.info.providerID }) both keep model and variant distinct at that point — something downstream rejoins them into one invalid string.
Error observed:
Model not found: litellm/us-gov.anthropic.claude-sonnet-5#medium
The configured model ID (litellm/us-gov.anthropic.claude-sonnet-5#medium) is invalid. Suggested valid alternatives: us-gov.anthropic.claude-sonnet-5, us-gov.anthropic.claude-opus-4-8, us-gov.anthropic.claude-opus-5.
Plugins
none
OpenCode version
1.18.30
Steps to reproduce
Select a non-default reasoning-effort variant on a session (e.g., cycle via the variant keybind to "medium").
Spawn a subagent via the Task tool, targeting an agent definition that has no variant of its own.
Observe the request fails with: Model not found: /#
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
Activity
github-actions commentedon Sep 22, 2026
This issue might be a duplicate of existing issues. Please check:
For keybind-related issues, please also check our pinned keybinds documentation: #4997
Skyworkdev commentedon Sep 22, 2026
Not the same bug related theme, different failure mode:
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊