Skip to content

fix: strip tagless reminders and dedupe replay history (0.3.2) - #52

Merged
william0wang merged 3 commits into
mainfrom
fix/replay-untagged-reminders
Aug 17, 2026
Merged

fix: strip tagless reminders and dedupe replay history (0.3.2)#52
william0wang merged 3 commits into
mainfrom
fix/replay-untagged-reminders

Conversation

@william0wang

Copy link
Copy Markdown
Owner

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 live session/messages payloads — 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. fetchMessages now dedupes by message id — kept once, at the original position with the latest content. replayMeta counts become accurate as a side effect.

Testing

  • 584 tests pass, typecheck/lint/build clean
  • New coverage: tag-less nudge dropped / user text before-or-after survives / ordinary tool-name mentions untouched / backend-duplicated id replayed once / distinct ids with identical text both kept

@william0wang
william0wang merged commit 8242518 into main Aug 17, 2026
1 check passed
@william0wang
william0wang deleted the fix/replay-untagged-reminders branch August 17, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant