Repository navigation
feat(core): fit output limits to the context window - #51021
Closed
rekram1-node wants to merge 1 commit into
Closed
rekram1-node wants to merge 1 commit into
rekram1-node wants to merge 1 commit into
Conversation
rekram1-node
force-pushed
the
max-output-tokens
branch
6 times, most recently
from
September 24, 2026 05:39
39f95b1 to
a4155f1
Compare
rekram1-node
force-pushed
the
max-output-tokens
branch
3 times, most recently
from
September 24, 2026 15:10
aab85ea to
ea4a18b
Compare
This was referenced Sep 24, 2026
rekram1-node
force-pushed
the
max-output-tokens
branch
from
September 24, 2026 15:26
ea4a18b to
4f83ba3
Compare
This was referenced Sep 24, 2026
rekram1-node
force-pushed
the
max-output-tokens
branch
from
September 24, 2026 16:02
4f83ba3 to
2e3077d
Compare
This was referenced Sep 24, 2026
rekram1-node
force-pushed
the
max-output-tokens
branch
from
September 24, 2026 18:22
2e3077d to
2450c57
Compare
3 of 6 tasks
rekram1-node
force-pushed
the
max-output-tokens
branch
4 times, most recently
from
September 24, 2026 20:33
a0dcc13 to
db84fed
Compare
rekram1-node
force-pushed
the
max-output-tokens
branch
from
September 24, 2026 21:11
db84fed to
0e00123
Compare
This was referenced Sep 24, 2026
Collaborator
Author
|
Superseded by #51238, which now includes this change and its tests in the audited single PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #46595
Closes #47398
Type of change
What does this PR do?
Ready to merge. The fixes for thinking budgets that break once a limit is sent are merged: #51150, #51151, #51154, #51157, #51189 and #51190.
V2 only sent an output limit on Anthropic, a fixed 32k. Every other route got the provider default: 4,096 on Bedrock Claude, 2,000 on Bedrock Nova, and 4,096 on many OpenAI-compatible proxies. Long thinking turns were cut off and ended with no text.
Default limit.
SessionModelRequest.preparenow sets an output limit for main steps and compaction summaries:options, so plugins can change or remove it.There is no recovery when a provider rejects the limit. The cap and the fit keep requests within what providers accept. A wrong catalog value surfaces as the provider's error until models.dev or the user's config is fixed.
Overlaps with #47532, which sets the catalog
limit.outputbut has no context fit.Not in this PR: recovering when a response actually hits the limit, such as a thinking-only response or a cut-off tool call.
How did you verify your code works?
bun run checkpasses.packages/aisuite passes, and so do the affectedpackages/coresession and plugin suites.Screenshots / recordings
N/A
Checklist