Skip to content

fix: prevent phantom notifications on worktree shutdown - #700

Merged
AmethystLiang merged 1 commit into
mainfrom
rm-phatom-alerts
Apr 16, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
rm-phatom-alerts

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

  • Unregister PTY data handlers before killing PTYs during worktree shutdown so the final data flush cannot trigger bell/agent-status notifications
  • Cancel accumulated closure state (staleTitleTimer, agent tracker) via teardown callbacks registered per-transport
  • Add a hasLivePtys guard at notification dispatch time as a belt-and-suspenders safety net
  • Add reset() to createAgentStatusTracker to clear stale working→idle transitions

Test plan

  • New test: unregisterPtyDataHandlers prevents final data burst from triggering notifications
  • New test: unregisterPtyDataHandlers cancels staleTitleTimer so it cannot fire stale idle transition
  • Manual: open worktree, run agent task, shut down worktree — verify no phantom notification appears

Unregister PTY data handlers before killing PTYs during worktree
shutdown so the final data flush cannot trigger bell/agent-status
notifications. Also cancels accumulated closure state (staleTitleTimer,
agent tracker) via teardown callbacks, and adds a hasLivePtys guard
at notification dispatch time as a belt-and-suspenders check.
@AmethystLiang
AmethystLiang merged commit 250dd77 into main Apr 16, 2026
1 check passed
@AmethystLiang
AmethystLiang deleted the rm-phatom-alerts branch April 16, 2026 05:39
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…als (stablyai#700)

Unregister PTY data handlers before killing PTYs during worktree
shutdown so the final data flush cannot trigger bell/agent-status
notifications. Also cancels accumulated closure state (staleTitleTimer,
agent tracker) via teardown callbacks, and adds a hasLivePtys guard
at notification dispatch time as a belt-and-suspenders check.
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