Expose approval-requested event to external notify hook
What variant of Codex are you using?
IDE extension (VSCode / Cursor Open-VSX extension)
What feature would you like to see?
Summary
The external notify hook currently seems to be invoked only for agent-turn-complete events.
It would be very useful if Codex could also invoke the external notifier when a task enters a state that requires human intervention (for example destructive command approval or sandbox escalation).
This would allow users to receive remote notifications when Codex is blocked waiting for approval.
Additional information
Motivation
I configured the notify hook to send mobile push notifications (via Pushover) when a Codex task finishes.
This works well for completion events, but I also expected to receive a notification when Codex requires my intervention to continue.
In background or IDE-driven workflows (Cursor, VS Code, Open-VSX integrations), a task can remain blocked indefinitely if the approval prompt is not noticed in the UI.
Having an externally observable approval state would significantly improve unattended or long-running usage.
---
Observed behaviour
When Codex requests approval (for example before running a destructive command), the external notify hook is not invoked and no corresponding event is emitted.
My notifier logs only show agent-turn-complete events even when an approval prompt is visible.
Example log excerpt:
{"type":"agent-turn-complete", ...}
No approval-requested or similar event is emitted.
---
Proposed improvement
Expose an additional event type to the external notifier hook, for example:
"type": "approval-requested"
Codex could invoke the notifier when:
- destructive command approval is requested
- sandbox escalation approval is requested
- any state requiring user intervention is reached
Example payload:
{
"type": "approval-requested",
"cwd": "...",
"thread-id": "...",
"turn-id": "...",
"reason": "destructive_command",
"command": "rm test.txt"
}
---
Expected benefits
- Enables reliable background usage of Codex
- Allows integration with mobile notification systems (Pushover, Slack, email, etc.)
- Improves long-running agent workflows
- Helps remote development setups
- Makes Codex more automation-friendly
---
Possible extension
It could also be useful to allow configuring which events trigger the notifier, for example:
notify_events = [
"agent-turn-complete",
"approval-requested"
]
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This is part of #2109 which is partially implemented already, and more will be coming soon.
This is great news, Thanks!!
I hit the same limitation in the Codex CLI/TUI on Ubuntu 24.04 LTS, running inside GNOME Terminal attached to tmux.
I now have
notifyworking well foragent-turn-completewith a local script that triggersnotify-sendplus a repeated sound. That solves the completion case.The missing piece is approvals:
tui.notifications = ["approval-requested"]can ring the terminal bell, but the externalnotifycommand still does not fire for approval prompts. In practice that means a long-running/background Codex session can stall indefinitely waiting for approval unless I happen to notice the terminal.For my workflow, a configurable external notification on approval requests would be very valuable, especially because GNOME Terminal itself does not offer a rich visual per-tab bell indicator, so the external notifier is the most flexible integration point.
The payload does not need to be huge, but at minimum it would be useful to receive:
type = "approval-requested"cwdthread-idturn-idcommand, changed path summary, host/protocol for network approvals)A matching
approval-resolvedevent would also be useful, butapproval-requestedis the critical one.This would make background and semi-unattended Codex workflows much more practical.
We built a notification bridge that catches approval events and forwards them as push notifications. Works across Codex, Claude Code, and Cursor:
https://github.com/user-attachments/assets/5714b528-7e04-478e-abfd-2a3d05db562c
https://github.com/DevinoSolutions/ai-agent-notifier