fix: strip tagless reminders and dedupe replay history (0.3.2) - #52
Merged
Conversation
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
Two replay-quality fixes for remote clients, found by replaying live sessions through the hub WS path, plus the 0.3.2 release bump.
Fix 1 — harness reminders rendered as user input (
35017ff)The agent runtime periodically injects TodoWrite/Read usage nudges into the conversation as pseudo-user turns. Stored history carries them WITHOUT
<system-reminder>tags (verified against livesession/messagespayloads — 5 of 9 user chunks in one sample were plumbing), so the tag-based strip never matched and remote clients rendered them as user-sent messages, accumulating over time. User-typed text and the appended plumbing share one stored message, which is why sent messages showed "only the beginning plus extra tail".The strip now anchors on the nudge's stable opening signature and fixed closing sentence, plus the optional bracket-wrapped todo dump. Reminder-only turns are dropped entirely; mixed messages keep only the typed text.
Fix 2 — identical paragraphs replayed twice (
c5e8d72)The backend can return the same message id at multiple non-adjacent positions in
session/messages(observed: 21 of 42 messages in a live sample were exact duplicates). Every copy was replayed, so clients rendered the same paragraph twice per duplicate.fetchMessagesnow dedupes by message id — kept once, at the original position with the latest content.replayMetacounts become accurate as a side effect.Testing