Skip to content

fix: suppress duplicate Codex notifications#41

Merged
mylee04 merged 3 commits intomylee04:mainfrom
jw-12138:ux/codex-dup-notification
Mar 30, 2026
Merged

fix: suppress duplicate Codex notifications#41
mylee04 merged 3 commits intomylee04:mainfrom
jw-12138:ux/codex-dup-notification

Conversation

@jw-12138
Copy link
Copy Markdown
Contributor

Summary

Suppress code-notify only for Codex events triggered by desktop-app sessions, while keeping notifications for standalone CLI sessions.

Why

Duplicate notifications happen when a Codex session is running inside the desktop app, because the desktop app already sends its own notification.

A standalone codex CLI session should still notify, even if the desktop app is also open.

Implementation

  • inspect the Codex notify payload client as the first signal for desktop-app events
  • when thread-id is present, resolve the thread through local Codex state
  • read the rollout session_meta and use payload.originator to detect Codex Desktop
  • suppress notifications only when the event belongs to a desktop-app session
  • keep the test override env var as CODE_NOTIFY_SKIP_CODEX_DESKTOP_CHECK

Tests

  • bash tests/test-codex-notify.sh
  • bash tests/test-notification-dedupe.sh

- Add has_desktop_app_running() to detect when a tool's desktop app
  (e.g. Codex app) is running alongside its CLI
- When detected, suppress code-notify since the desktop app sends
  its own notifications
- macOS only — uses pgrep to check for .app bundle processes
- Add CODE_NOTIFY_SKIP_DESKTOP_CHECK env var for test isolation
@mylee04 mylee04 merged commit ec8e51f into mylee04:main Mar 30, 2026
2 checks passed
@mylee04
Copy link
Copy Markdown
Owner

mylee04 commented Mar 30, 2026

Thanks for the cleanup here. This is a much better direction than the earlier broad desktop-app suppression approach, and I appreciate that you tightened it around actual Codex trigger origin instead of just checking whether the desktop app is open. The added test coverage for desktop-origin vs CLI-origin events also helps a lot.

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.

2 participants