Skip to content

fix(agent-status): suppress replayed completion notifications - #12998

Closed
innocarpe wants to merge 1 commit into
stablyai:mainfrom
innocarpe:fix/replay-agent-status-notifications
Closed

innocarpe wants to merge 1 commit into
stablyai:mainfrom
innocarpe:fix/replay-agent-status-notifications

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

Description

Prevent reconnect-replayed agent statuses from firing duplicate task-complete notifications.

Focused fix

  • In scope: preserve replay provenance through the agent-status IPC payload and suppress completion observation for replayed live-set events.
  • Out of scope: status rendering, replay snapshot application, live completion notifications, and agent-hook state transitions.

Preserves

  • Replayed statuses still update the renderer's visible agent state, while a newly observed live completion remains eligible for its notification.

Evidence

  • Test: pnpm exec vitest run --config config/vitest.config.ts src/main/agent-hooks/server.test.ts src/renderer/src/hooks/useIpcEvents.test.ts --reporter=dot
  • Changed-code quality: pnpm run check:code-quality:changed -- upstream/main
  • Regression coverage passed: 369 tests, including replay provenance and notification suppression.

User-regression-tradeoffs

  • Reconnects no longer repeat completion notifications for work that already finished; live status updates and first-time completion notifications remain unchanged.

Fixes #12747

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 459a01ec-d4a2-4ebb-9835-fd518f0218f2

📥 Commits

Reviewing files that changed from the base of the PR and between 7e60b33 and 1405e8a.

📒 Files selected for processing (6)
  • src/main/agent-hooks/server.test.ts
  • src/main/agent-hooks/server.ts
  • src/main/index.ts
  • src/renderer/src/hooks/useIpcEvents.test.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/shared/agent-status-types.ts

📝 Walkthrough

Walkthrough

The change adds optional isReplay metadata to agent status IPC payloads. Main-process status forwarding preserves this metadata for replayed events and cached status entries. Renderer status handling excludes replayed events from completion notifications while still applying their terminal state, metadata, and title. Tests cover propagation through renderer listeners and status snapshots, plus replayed completion handling.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the fix and testing, but it omits required Screenshots, AI Review Report, Security Audit, Notes, and testing checklist sections. Add the missing template sections, state whether there is a visual change, document AI and security reviews, confirm platform compatibility, and complete the testing checklist.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: suppressing completion notifications for replayed agent statuses.
Linked Issues check ✅ Passed The changes carry replay provenance through IPC and suppress notifications for replayed statuses while preserving state updates, satisfying issue #12747.
Out of Scope Changes check ✅ Passed The implementation and regression tests are directly related to preventing duplicate notifications from replayed agent statuses.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@innocarpe

Copy link
Copy Markdown
Contributor Author

Closing in favor of maintainer #14635, which supersedes this PR.

That replacement keeps the turn identity across the SSH connection_lost clear so the existing renderer dedupe still matches, instead of skipping replayed notifications in the renderer. That preserves attention and hook-lifecycle observation on reconnect, which this isReplay skip would have dropped.

The fork portfolio mirror will be closed to match.

@innocarpe innocarpe closed this Aug 15, 2026
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.

Reconnect replays of cached agent statuses re-fire task-complete notifications

3 participants