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
DeepSeek V4 models declare a 384K/393,216-token output limit, but ProviderTransform.maxOutputTokens() applies the global 32K default to every model. Requests therefore send 32K even though DeepSeek V4 advertises a much larger supported output budget.
DeepSeek V4 should use its positive model-declared output limit by default. Other model families should retain the existing 32K default, and an explicit OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX should remain authoritative.
Plugins
None
OpenCode version
1.18.4
Steps to reproduce
Configure a DeepSeek V4 model with its models.dev output limit.
Start a request without setting OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX.
Observe that the request max output tokens is 32,000 instead of 384,000/393,216.
If your issue is distinct from the above (e.g. you specifically want model-declared output limits to be respected automatically without any config override), please clarify the difference in a comment so maintainers can track it separately.
Clarifying the distinction from #29363: this issue targets the no-override path for DeepSeek V4. The model metadata already declares a 384K/393,216 output limit, but the shipped dev path still replaces it with the generic 32K default in ProviderTransform.maxOutputTokens(). #38232 deliberately keeps 32K for other model families and preserves OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX, so the change is narrow and low-risk while the broader v2 rewrite is pending.
I synced #38232 with current dev in 31f8b4195a, resolved the conflict, and revalidated the focused tests and typecheck.
Activity
github-actions commentedon Jul 22, 2026
This issue might be a duplicate of existing issues. Please check:
limit.outputin config is silently capped at 32k;OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAXis a poor workaround #29363:limit.outputis silently capped at 32k with the same root cause —ProviderTransform.maxOutputTokens()applying the 32K global default regardless of model-declared limits, andOPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAXbeing the only workaroundmax_completion_tokensvalue — related DeepSeek token limit handling issueIf your issue is distinct from the above (e.g. you specifically want model-declared output limits to be respected automatically without any config override), please clarify the difference in a comment so maintainers can track it separately.
punkisnotdead3 commentedon Sep 9, 2026
Clarifying the distinction from #29363: this issue targets the no-override path for DeepSeek V4. The model metadata already declares a 384K/393,216 output limit, but the shipped
devpath still replaces it with the generic 32K default inProviderTransform.maxOutputTokens(). #38232 deliberately keeps 32K for other model families and preservesOPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX, so the change is narrow and low-risk while the broader v2 rewrite is pending.I synced #38232 with current
devin31f8b4195a, resolved the conflict, and revalidated the focused tests and typecheck.neriousy commentedon Oct 1, 2026
Closing as a duplicate of #29363. DeepSeek is one case of the general per-step output cap tracked in #29363.
limit.outputin config is silently capped at 32k;OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAXis a poor workaround #29363