Uh oh!
There was an error while loading. Please reload this page.
fix(opencode): respect model limit.output config instead of capping at 32k - #29679
fix(opencode): respect model limit.output config instead of capping at 32k#29679JunJieLiu51520 wants to merge 1 commit into
Conversation
…t 32k maxOutputTokens() used Math.min(model.limit.output, 32000) which silently capped any configured output limit at 32k tokens. Now the model's configured limit.output is honored when set, falling back to 32k only when unset. Closesanomalyco#29363
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #29513: Why it's related: This PR appears to be addressing the same issue - respecting the model's |
JunJieLiu51520
commented
May 29, 2026
Hi @rekram1-node 👋 — I've opened a PR that addresses this issue. Would you be able to take a look when you have a moment? PR: #29679 |
Issue for this PR
Closes#29363
Type of change
What does this PR do?
maxOutputTokens()usedMath.min(model.limit.output, outputTokenMax)which silently capped any configured output limit at the hardcoded 32k default. When users setlimit.output: 384000in their model config, the actual value sent to the API was still 32k.Changed to honor
model.limit.outputwhen it is explicitly configured (> 0), only falling back to the 32k default when unset.How did you verify your code works?
Traced the call path: when a model has
limit.output: 384000, the function now returns384000instead ofMath.min(384000, 32000) = 32000. Whenlimit.outputis 0 or unset, it falls back toOUTPUT_TOKEN_MAX(32000) as before.Checklist