fix(ds4): enforce generation boundaries - #11821
Open
FiloSpaTeam wants to merge 1 commit into
Open
Conversation
FiloSpaTeam
force-pushed
the
fix/ds4-generation-boundaries
branch
from
September 1, 2026 14:26
41987c0 to
114687f
Compare
Clamp requested generation to the usable context after prompt sync while preserving the legacy 256-token fallback for omitted limits. Constrain each speculative MTP cycle to the remaining request budget so accepted tokens cannot advance beyond the visible output limit. Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Claudio Maradonna <git@codeshifter.xyz>
FiloSpaTeam
force-pushed
the
fix/ds4-generation-boundaries
branch
from
September 1, 2026 14:35
114687f to
877efad
Compare
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.
Clamp requested generation to the usable context after prompt sync while preserving the legacy 256-token fallback for omitted limits.
Constrain each speculative MTP cycle to the remaining request budget so accepted tokens cannot advance beyond the visible output limit.
Assisted-by: Codex:gpt-5.6-sol
Description
This PR fixes DS4 generation boundary handling in both streaming and non-streaming requests.
Explicit generation limits are clamped after prompt synchronization using the remaining context capacity. Omitted or non-positive limits retain the legacy 256-token fallback.
Speculative MTP decoding is also constrained by the remaining request budget, preventing accepted tokens from advancing beyond the visible output limit.
Notes for Reviewers
max_tokens: 32768is treated as an upper bound and may be reduced to fit the available model context.Signed commits