Skip to content

Improve notification reliability#19

Open
dtran320 wants to merge 2 commits intomainfrom
feature/notification-reliability
Open

Improve notification reliability#19
dtran320 wants to merge 2 commits intomainfrom
feature/notification-reliability

Conversation

@dtran320
Copy link
Copy Markdown
Member

@dtran320 dtran320 commented Mar 5, 2026

Summary

  • Increase stdin read timeout from 0.1s to 0.5s to avoid missing hook payloads under load
  • Add fallback session ID lookup by PPID when Notification hook has different cwd than PostToolUse
  • Return notification_shown boolean from Electron /api/notify and /notify endpoints
  • Fall back to browser tracker when Electron can't show native notifications

Based on ideas from #16 (now closed), reimplemented against current main.

Test plan

  • Verify hook payloads are reliably read (no missed events)
  • Test notification when PostToolUse and Notification hooks fire from different directories
  • Confirm Electron returns notification_shown in /api/notify response
  • Verify browser tracker fallback when Electron notifications unavailable

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

dtran320 and others added 2 commits March 5, 2026 13:24
…tification_shown

- Increase stdin read timeout from 0.1s to 0.5s to avoid missing payloads
- Add fallback session ID lookup by PPID when cwd differs between hooks
- Return notification_shown from Electron /api/notify and /notify endpoints
- Fall back to browser tracker when Electron notification unsupported

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change PPID glob from {ppid}* to {ppid}-* to prevent prefix collisions
- Wrap stat() in sort key with try/except for race-deletion safety
- Legacy /notify endpoint returns notification_shown: false (no .show() call)
- Skip 0.5s stdin timeout when running interactively (isatty check)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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