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: child sessions fail on providers that only support tool_choice auto #54772
Subagent child sessions fail immediately with only "auto" is supported for tool_choice on providers/models that don't accept tool_choice values "none", "required", or named function choices. This makes file-based subagents unusable on those providers and blocks autonomous multi-agent workflows.
Environment
opencode version: 2.0.26
OS: Windows_NT 10.0.19045 (win32 x64)
Terminal: TERM=xterm-256color
Shell: C:\WINDOWS\system32\cmd.exe
Install/channel: latest
Active plugins: None found in config
Reproduction
Define a file-based subagent (.opencode/agents/*.md, mode: subagent) with model: pointing at a provider that only supports tool_choice: "auto" (observed with opencode/muse-spark-1.3-contributor-free, all variants and no-variant).
Invoke it via the subagent tool from a parent session.
Observe immediate failure; repeated across 6+ invocations and 3 different agent definitions.
Expected Behavior
The child session runs with tool_choice: "auto" (or the runner avoids setting an unsupported value), so subagents work on any provider.
Actual Behavior
Subagent failed (sessionID: ses_...): only `"auto"` is supported for
`tool_choice`. `"none"`, `"required"`, and named function choices are
not currently supported
Failure is intermittent per call (2 of ~8 calls partially/completely succeeded and produced correct file output before the error surfaced), suggesting the unsupported value is set on some code paths (possibly final-step tool removal or a specific tool call) rather than unconditionally. No user-side workaround: model variants, prompt changes, and service restarts don't help.
Additional Context
Frequency: consistent-but-intermittent — same agent+prompt fails instantly on some attempts and executes (partially or fully) on others.
Related misleading error: when the same runner hits adacode API 500s on completions, opencode surfaces Unauthorized: API key tidak dikenali although the key is valid (verified via direct /v1/models call, HTTP 200). Possibly a separate error-mapping issue.
Impact: blocks the documented primary→subagent orchestration pattern on affected providers; only provider with reliable subagent runs in our testing was adacode post-purchase (when its API wasn't 500ing).
Workarounds tried (no help): removing model #variant, opencode reload, opencode service restart (pids cycled, port stable).
Thanks for the detailed report! I think this is a duplicate of #45953.
In 2.0.26 the session runner only sends a non-autotool_choice in one case: on the final step, after an agent reaches its steps: limit, it sends tool_choice: "none" so the model writes a text summary. Providers that only accept "auto" reject that request. That would explain why it looks intermittent: runs that finish before the cap succeed, and runs that reach it fail. If your subagent definitions set steps:, raising the cap (or removing it) should avoid the error until this is fixed.
Possible duplicates and related issues, ordered by likelihood:
The misleading Unauthorized error when adacode returns 500s looks like a separate problem. Please open a new issue for it if it keeps happening.
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different (for example, if it fails on runs that never reach a steps limit).
Closing this as a duplicate of #45953, since we haven't heard back on how this differs. That issue covers the same only "auto" is supported for tool_choice failure. Please follow it there for updates. You can also add a 👍 or any extra details, such as whether your subagents set a steps: limit.
If you find this happens on runs that never reach a steps limit, reply here and we can reopen it. The adacode 500 → Unauthorized error mapping is a separate problem, so please open a new issue for it if it keeps happening. Thanks again for the detailed report!
Activity
opencode-agent commentedon Oct 12, 2026
Thanks for the detailed report! I think this is a duplicate of #45953.
In 2.0.26 the session runner only sends a non-
autotool_choicein one case: on the final step, after an agent reaches itssteps:limit, it sendstool_choice: "none"so the model writes a text summary. Providers that only accept"auto"reject that request. That would explain why it looks intermittent: runs that finish before the cap succeed, and runs that reach it fail. If your subagent definitions setsteps:, raising the cap (or removing it) should avoid the error until this is fixed.Possible duplicates and related issues, ordered by likelihood:
"none"/"required"/namedtool_choice, which providers that only support"auto"reject (also seen on subagent runs withmuse-spark).tool_choice: "none"failure when an agent hits itsstepslimit onopencodefree-tier models (closed).tool_choice: "required", which some models reject.The misleading
Unauthorizederror when adacode returns 500s looks like a separate problem. Please open a new issue for it if it keeps happening.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different (for example, if it fails on runs that never reach a
stepslimit).opencode-agent commentedon Oct 13, 2026
Closing this as a duplicate of #45953, since we haven't heard back on how this differs. That issue covers the same
only "auto" is supported for tool_choicefailure. Please follow it there for updates. You can also add a 👍 or any extra details, such as whether your subagents set asteps:limit.If you find this happens on runs that never reach a
stepslimit, reply here and we can reopen it. The adacode 500 →Unauthorizederror mapping is a separate problem, so please open a new issue for it if it keeps happening. Thanks again for the detailed report!