I’ve整理 up the fix I just used locally for Codex’s missed notifications into a small tool:
I also posted it to the openai/codex discussion board:
What it solves: Codex’s default “turn finished” notification doesn’t cover all the scenarios where you actually need to come back and handle something. For example, when a task runs halfway and needs a permission approval, or when it’s about to run commands like sudo xcodebuild -license accept, installers, softwareupdate, etc. that are very likely to require an admin password—if the window isn’t in the foreground, it’s easy to assume Codex is still running, when in fact it’s already stuck waiting for you.
What it does:
- Pops a macOS system notification when Codex emits a
PermissionRequest. - Warns you in advance before running common commands that require manual intervention, e.g.
sudo,xcodebuild -license,xcodebuild -runFirstLaunch,.pkginstaller,softwareupdate, AppleScript administrator privileges. - Doesn’t notify for normal commands—so it won’t pop up for every
ls,git, or build. - Only does notifications and logging; it won’t auto-approve/deny or rewrite Codex tool calls.
- Logs to
~/.codex/logs/codex-attention-notifier.log.
Installation:
git clone https://github.com/constansino/codex-attention-notifier.git
cd codex-attention-notifier
python3 install.py
After installing, restart Codex Desktop, or start a new Codex session so the new hooks config takes effect.
You can test with this command—it won’t actually run sudo; it just simulates Codex hook input:
printf '%s\n' '{"hook_event_name":"PreToolUse","tool_name":"Bash","cwd":"'"$PWD"'","tool_input":{"command":"sudo xcodebuild -license accept"}}' \
| python3 ~/.codex/hooks/codex_attention_notify.py
If it’s working, you’ll see a macOS notification, and you can also see the log:
tail -n 5 ~/.codex/logs/codex-attention-notifier.log
Limitations are also spelled out clearly: this isn’t an official first-class feature—just a practical patch built on Codex hooks. For the case where a subprocess has already started and then gets stuck on stdin/password, Codex currently doesn’t have a stable “waiting for input” event hook, so this tool covers common scenarios by identifying high-risk commands before execution.