Repository navigation
fix(notifications): a reconnect replay no longer re-fires task-complete notifications - #29410
Conversation
…te notifications Carry the host's isReplay flag through the agentStatus:set IPC payload so the renderer seeds completion tracking from replayed rows, as it already does for the startup snapshot, instead of treating each cached done as a new turn.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
When the connection to a remote host drops and comes back, the host re-sends the last status of every agent so the app can catch up. The app was treating each re-sent "finished" status as a brand-new finish, so every reconnect fired another "Claude finished" notification for work that was already done. During a flaky connection that meant dozens of duplicate notifications in a few minutes.
What Changed
Mechanism:
isReplay: true. The main process dropped that flag when it forwarded the row to the window overagentStatus:set. It now forwards it (src/main/startup/main-window-agent-status.ts). The newisReplay?field is optional onAgentStatusIpcPayload.workingonly seeds completion tracking, and a replayeddoneis not treated as a completion (agent-status-event-applicator.ts). Nothing else about replay handling changes, including pending-pane queueing and retirement acknowledgement.Why
The startup snapshot path already solved this exact problem: cached rows seed completion tracking and never dispatch a notification. The live replay path skipped that rule only because the flag was lost on the way to the window. Reusing the snapshot rule keeps a single definition of "a replayed row does not notify".
Alternatives considered:
Trade-off: an agent that finished while the connection was down shows as done after reconnect but doesn't notify, the same as the startup snapshot today.
Supersedes #12750 (same direction, written against a pre-split
index.ts, now conflicting).Linked Issue
Linear STA-3524
Visual Proof
N/A. This only changes whether a duplicate OS notification fires. Nothing in the UI renders differently.
Testing
src/renderer/src/hooks/ipc-events/agent-status-reconnect-replay-notification.test.ts: a replayeddoneupdates status without being observed as a completion, and a replayedworkingseeds tracking so the next realdonestill notifies. Both tests fail without the fix.src/main/startup/main-window-structured-status-filter.test.ts: the window fanout forwardsisReplayonly on replayed rows.Review
Codex review (gpt-6.1-sol, high): no findings.
Agent skill upstream boundary
Notes
pickParsedAgentStatusPayloaddoesn't copy the new field, so no published projection changes.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)