You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: flush pending message_end on new turn, finalize orphaned current
In multi-turn streaming-input sessions, message_start for turn N+1
could arrive before the deferred message_end for turn N flushed.
The message_start handler reset pendingMessageEnd to null, silently
dropping turn N's message_end. On the frontend, MESSAGE_START
overwrote current without finalizing it into messages[].
Server: extract forceFlushPendingMessage() helper that force-closes
open blocks and emits the pending message_end. Called from both the
message_start handler (before resetting turn state) and the result
handler (before session_end). DRYs the duplicated flush logic.
Frontend: MESSAGE_START now finalizes any orphaned current into
messages[] before creating the new streaming message. Belt-and-
suspenders against any remaining server ordering edge cases.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Made-with: Cursor
0 commit comments