Repository navigation
fix(room): give a reloaded run's work band to the reply the history shows - #610
Merged
Merged
Conversation
…hows On reload, replayToTrackers decided which reply took a run's work band by re-deriving it from the stored events: a reply with non-blank content whose TEXT_MESSAGE_END was stored. That copy of the history replay's rule had drifted from it, so the band landed in the wrong place in two cases: - a reply cut off by RUN_ERROR or RUN_FINISHED before its end is committed by the history replay, but its band fell back to the run's no-response tile; - a reply whose stream another reply opened over is never committed, but it still took the band, which then named a tile that never renders. replayToTrackers now takes the ThreadHistory and hands a run's work only to a reply in its messages with non-blank text, so the band follows the replies the timeline shows. Tests that fed the function raw bundles now build the history through the real client. Adds a live/reload parity test for the cut-off reply, and replay tests for the reply the history drops and for a call left open when a run's stored events run out. Drops replay tests that pinned no decision another test does not already pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
On a reloaded thread, a run's work band now goes to the replies the timeline
actually shows. Before,
replayToTrackersre-derived "which reply spoke" fromthe stored events (non-blank content plus a stored
TEXT_MESSAGE_END). Thatcopy of the history replay's rule had drifted from the original, so the band
landed in the wrong place:
RUN_ERROR/RUN_FINISHEDbefore its end. Thehistory replay commits the partial reply (
commitPartialTextOnTerminal),but its band fell back to the run's no-response tile.
took the band, which then pointed at a tile that never renders.
replayToTrackersnow takes theThreadHistoryand hands a run's work onlyto a reply in
history.messageswith non-blank text. The assistant-rolecheck stays where it was, on the AG-UI
TEXT_MESSAGE_STARTevent.Changes
historical_replay.dart: takesThreadHistory; onespeakingset builtfrom
history.messagesreplaces the per-runended/spokesets. Doccomment updated to match.
thread_view_state.dart: passeshistoryinstead ofhistory.runs.(
storedHistory) instead of passing raw bundles.call left open when the stored events run out is failed. The second
pins
endedOn, which no test covered before.already pin. Checked by breaking
replayToTrackers19 different ways:every break caught before the removal is still caught after.
Notes
uuid4()id, so amessage id shared across runs, which would make one run's band overwrite
another's, is not handled.
thread_view_state_test.dart's "a send from a disposed view does notthrow" still prints a
signal warning: … read after disposed. It predatesthis change, and there is no cheap fix.
Test Plan
flutter test test/modules/room: 1639 passflutter analyze: no issuesthat the reply carries its work band
Related Issues
Related to #602
🤖 Generated with Claude Code