Skip to content

fix(server): unify multi-segment Responses reasoning - #2498

Merged
inureyes merged 1 commit into
mainfrom
fix/pr-2496-postmerge-hardening
Oct 20, 2026
Merged

inureyes merged 1 commit into
mainfrom
fix/pr-2496-postmerge-hardening

Conversation

@inureyes

Copy link
Copy Markdown
Member

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

  • CUDA tool-call, Responses and reasoning regressions: 580 passed; delimiter-dense reasoning replay: 1 passed.
  • 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.
  • Real GB10 HTTP tests passed: Llama 3.1 8B 4-bit produced one tool call without raw call content; GPT-OSS 20B MXFP4 returned identical reasoning and 44 reasoning tokens in both Responses modes.
  • The multi-segment Responses mismatch disclosed in the original PR is fixed. Its unmarked bare-JSON tool-call and chat whitespace caveats remain outside this correction.

Refs #2470

Refs #2496

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
@inureyes inureyes added type:bug Bug fixes, error corrections, or issue resolutions status:review Under review priority:medium Medium priority labels Oct 20, 2026
@inureyes inureyes self-assigned this Oct 20, 2026
@inureyes
inureyes merged commit c6b784f into main Oct 20, 2026
28 checks passed
@inureyes inureyes added status:done Completed and removed status:review Under review labels Oct 20, 2026
@inureyes
inureyes deleted the fix/pr-2496-postmerge-hardening branch October 20, 2026 13:23
@inureyes inureyes added this to the 0.8 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority status:done Completed type:bug Bug fixes, error corrections, or issue resolutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant