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
server: session fails at steps limit because Zen gateway rejects tool_choice none #51906
A session whose agent hits its steps limit fails to drain on free-tier (opencode provider / Zen gateway) models with only "auto" is supported for 'tool_choice'. The documented final-step behavior (remove tools, ask model to summarize) cannot complete because the gateway rejects the tool_choice: "none" request.
Environment
opencode version: 2.0.18
OS: Windows_NT 10.0.26200 (win32 x64)
Terminal: Unavailable: terminal environment variables are not set
Define a custom agent with a steps cap (e.g. steps: 10).
Select a free-tier model (e.g. opencode/muse-spark-1.3-contributor-free#xhigh).
Run a task that needs more model steps than the cap (e.g. DB migration, test pass, code review via the subagent tool).
When the step count reaches the cap, the drain fails.
Expected Behavior
Reaching the steps limit should produce a text summary as documented ("On the final step, OpenCode removes tools and asks the model to summarize in text") instead of a provider error.
Actual Behavior
Failed to drain Session, cause AI.Error: Error from provider (Console): only '"auto"' is supported for 'tool_choice'. '"none"', '"required"', and named function choices are not currently supported.
Server log shows the failure in SessionStep.attempt / SessionRunner.drain.
Workaround: raise steps caps so real tasks finish before the cap (backend 30->100, qa 25->80, reviewer 10->40, etc.). Removing caps entirely was avoided to prevent runaway sessions.
Possibly related: free-tier sessions whose agent denies the shell tool fail with a different provider error (free tier can only be used from within OpenCode), suggesting the gateway validates request shape beyond auth.
The Bug Report template requires a Description field. The issue currently has a Summary section instead; please add or rename it to Description and keep the problem description there.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
Activity
github-actions commentedon Sep 28, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
autotool_choicevalues causing the same session failure.If you believe this was flagged incorrectly, please let a maintainer know.