Repository navigation
fix(server): unify multi-segment Responses reasoning - #2498
Merged
Merged
Conversation
Replay the shared streaming filter before parser fallbacks so multiple Harmony analysis and think blocks preserve identical reasoning text and token counts across response modes. Add regression cases with and without parsed tools and document the shared accumulation rule. Validated 581 CUDA tool-call, Responses and reasoning regressions, including multiple analysis segments and delimiter-dense input. Formatting and diff checks pass. Refs #2470 Refs #2496
3 of 4 tasks
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.
Summary
Follow-up hardening for merged PR #2496, reviewed against issue #2470. Non-streamed Responses could insert parser-only newlines between Harmony analysis segments or omit later think blocks, making reasoning text and token counts differ from streaming. Both modes now use the existing bounded streaming filter before legacy fallbacks. Regression tests cover both formats with and without tools, and the Responses documentation describes the common accumulation rule.
Security review found no additional authorization or input-boundary gaps. Tagged tool-call suppression remains intact. Performance review confirms bounded UTF-8 replay and token counting off the async executor are preserved; no separate Harmony parser was introduced.
Validation
cargo clippy -j 4 -p mlxcel --lib --tests -- -D warnings, formatting and diff checks passed; clippy used an independent target directory to exclude stale worktree artifacts.Refs #2470
Refs #2496