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
[Bug] OpenCode Go deepseek-v4-pro sends an invalid max_completion_tokens value #37947
When OpenClaw uses the OpenCode Go provider with deepseek-v4-pro, requests consistently fail before a response is generated:
400 max_completion_tokens=384000 cannot be greater than
max_model_len=max_total_tokens=135168. Please request fewer output tokens.
(parameter=max_completion_tokens value=384000)
The request appears to send max_completion_tokens=384000, whereas the upstream endpoint reports a total context limit of 135168 tokens.
Could you please confirm whether deepseek-v4-pro is mapped to the intended model? The reported context limit is incompatible with the configured completion limit and may indicate an incorrect model or context-limit mapping.
Expected behavior: OpenCode should cap max_completion_tokens to a value compatible with the actual model context window, or derive it from the provider's model metadata.
Plugins
OpenClaw integration / OpenCode Go provider.
OpenCode version
Not available from the OpenClaw integration.
Steps to reproduce
Configure OpenClaw to use the OpenCode Go provider.
Select deepseek-v4-pro.
Send a request.
The provider returns the HTTP 400 error shown above.
Screenshot and/or share link
No share link available. Error output is included above.
Activity
github-actions commentedon Jul 20, 2026
This issue might be a duplicate of existing issues. Please check:
max_completion_tokensderived from a stale context window value)deepseek/deepseek-v4-proreports wrong context size (65536 instead of ~1M), which would cause an over-largemax_completion_tokensto be sentmax_completion_tokensmust be <= model context length (closed)github-actions commentedon Sep 19, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.