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
Variant limit overrides ignored for maxOutputTokens and compaction #48323
When a model variant defines its own limit (e.g. a longer output cap), it is never used.
The variant is only merged into request options (session/llm/request.ts:80-91); a
nested variant.limit ends up as an inert key in provider options.
Why is this needed? Most models become more expensive after 272k token, i want to have variants to limit this without redefining it as a different model.
Both values derived from the output limit still use only the base model:
maxOutputTokens sent to the provider (request.ts:129, via transform.ts:1468: Math.min(model.limit.output, outputTokenMax) || outputTokenMax)
Suggested fix: resolve the effective output limit as variant -> model -> default before
clamping. maxOutputTokens already has everything it needs at request.ts:80 (the variant is
already resolved there); overflow.ts would additionally need the active variant passed in.
Activity
github-actions commentedon Sep 10, 2026
This issue might be related to existing issues around variant field handling. Please check:
chat_template_kwargs) are dropped before the request — similar root area (variant merging), though that issue focuses on body-level fields rather thanlimitoverrideslimit.outputnot reaching the provider, though in a different code path and providerthdxr 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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊