Repository navigation
fix(notifications): do not re-fire task-complete notifications for replayed agent statuses - #12750
robertnisipeanu wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change adds optional Merge Risk: ⚪ Minimal · up to This localized change prevents replayed task statuses from firing duplicate completion notifications while keeping status updates intact; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/hooks/useIpcEvents.ts (1)
3281-3284: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep the added replay comments concise.
src/renderer/src/hooks/useIpcEvents.ts#L3281-L3284: Replace the four-line rationale with one concise comment.src/renderer/src/hooks/useIpcEvents.test.ts#L6755-L6756: Remove the redundant explanation or reduce it to one line.As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through how the code works.”
Proposed fix
- // Why: local Codex/Claude hooks arrive via this main-process IPC path, not the PTY OSC fallback, so task-complete notifications must observe accepted hook state here too. - // Why isReplay is excluded like the startup snapshot: a reconnect replay re-delivers a cached - // terminal status the user was already notified about; observing it would fire the - // notification again on every reconnect cycle. + // Replays refresh status UI but must not repeat completion notifications.- // A reconnect replay re-delivers the cached terminal status. It must refresh the status UI - // without re-firing the task-complete notification the user already received.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e4673a11-0860-4543-8a19-ea79e4e53964
📥 Commits
Reviewing files that changed from the base of the PR and between eea0bb6 and 0bcb0dc45f4edeedbd8b2e23924591a31df90d6a.
📒 Files selected for processing (4)
src/main/index.tssrc/renderer/src/hooks/useIpcEvents.test.tssrc/renderer/src/hooks/useIpcEvents.tssrc/shared/agent-status-types.ts
…played agent statuses Co-Authored-By: Claude Fable 5 <[email protected]>
0bcb0dc to
2615193
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Superseded by #13974, which ships in v1.4.183: agent status replays now carry an explicit replay flag and task-complete notification observation is gated on it (useIpcEvents.ts, options?.replay !== true), covering the duplicate-notification case this PR addressed. |
|
Reopening: #13974 coalesces agent-status bursts and adds snapshot-path |
Carries the isReplay flag alongside upstream's observation forwarding in the main-process statusEvent, layers the isReplay exclusion onto the snapshot seedOnly notification condition in useIpcEvents (snapshot replays still seed working states; live reconnect replays are never observed), and ports the replayed-status suppression test to useIpcEvents-agent-status-snapshot-replay.test.ts after upstream split useIpcEvents.test.ts, adding isReplay to the shared AgentStatusSetData fixture. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AqNqAZQTwmAkwGcHj5TYXk
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Thanks, @robertnisipeanu! This was rebuilt on current main and merged in #29410 (your approach was used). Closing as superseded. |
Fixes #12747
Reconnect replays re-deliver cached agent statuses with
isReplay: true, but the flag was dropped from theagentStatus:setIPC payload, so the renderer treated each replayeddoneas a fresh completion and fired the task-complete notification again on every reconnect cycle.AgentStatusIpcPayloadcarriesisReplay.options.replay). Status UI still updates from the replay.🤖 Generated with Claude Code