fix(desktop): preserve streamed reasoning on late fallback - #65432
Closed
rasitakyol wants to merge 2 commits into
Closed
fix(desktop): preserve streamed reasoning on late fallback#65432rasitakyol wants to merge 2 commits into
rasitakyol wants to merge 2 commits into
Conversation
rasitakyol
marked this pull request as ready for review
July 16, 2026 07:07
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.
What does this PR do?
Prevents a late
reasoning.availablefallback from replacing reasoning that already streamed throughreasoning.delta. When no reasoning delta was received, the fallback is still inserted before assistant text. The backend now sends the complete inline reasoning fallback instead of truncating it to 500 characters.The frontend portion mechanically salvages #47183 onto the current split hook layout while preserving skyc1e's original commit authorship. The additional backend and end-to-end event coverage address #64995's truncation/remount case.
Related Issue
Fixes #64995
Salvages and extends #47183 with original author credit preserved. #64689 remains a separate MoA-reference accumulation fix.
Type of Change
Changes Made
apps/desktop/src/app/session/hooks/use-message-stream/index.ts: adds an idempotent late-reasoning fallback reducer, preserves the existing reasoning part object, and inserts a fallback before assistant text when no delta arrived.agent/conversation_loop.py: relays complete available reasoning without the 500-character truncation while preserving bounded subagent previews.How to Test
Stream more than 500 characters through
reasoning.delta, then emitreasoning.available; verify the displayed reasoning text and part identity remain unchanged.Emit assistant text followed by
reasoning.availablewithout prior reasoning deltas; verify reasoning appears before the text.Run:
Results:
git diff --checkpassedA parallel full-desktop run exposed an existing cross-file isolation race in
src/app/skills/index.test.tsx; the same file passed 3/3 in isolation, and the serial supported-Node run passed the complete suite.Checklist
Code
Documentation and Housekeeping
cli-config.yaml.example: N/A.Screenshots / Logs
No UI layout changes; regression tests exercise the gateway-event timeline and reasoning-part identity directly.