This repository was archived by the owner on Apr 14, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
fix: drain pending replay notifications before emitting replay_complete #163
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7c23b92
feat: add info-level session lifecycle logs to detect backend session…
matt2e 1de0162
chore: enable dotenv-load in justfile
matt2e 8fa89fb
feat: add replay diagnostics to trace incomplete session history loading
matt2e c72b98d
fix: drain pending replay notifications before counting events
matt2e dd51a72
test: add unit tests for replay buffer module
matt2e 047ab38
Revert "test: add unit tests for replay buffer module"
matt2e f4c100d
test: add unit tests for replay drain stabilisation logic
matt2e 5fdab4e
chore: remove debug logging and revert justfile config change
matt2e 9da3fed
fix: cap replay drain iterations and strengthen stability test assertion
matt2e 51b09a3
refactor: combine duplicate lock acquisitions in replay user message …
matt2e ed559e8
style: apply cargo fmt to dispatcher and session_ops
matt2e 933f4cd
fix: restore non-branch perf and error logs removed during cleanup
matt2e File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait_for_replay_drainwaits forreplay_eventsto stabilize, but this counter is only incremented when a new replay assistant message is created (plus user chunks), not for subsequentAgentMessageChunk/tool replay updates on the same message. That letsload_session_innercallfinalize_replayand emitacp:replay_completewhile replay chunks are still queued, and those late chunks can be dropped once the frontend marks the message completed (shouldTrackStreamingEventinuseAcpStream). Please increment the drain counter for every replay notification that can still mutate buffered replay state, or use a completion signal tied to the notification queue instead of message creation.Useful? React with 👍 / 👎.