Expose approval-requested event to external notify hook

Resolved 💬 5 comments Opened Mar 16, 2026 by ttrenty Closed Mar 16, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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"
]

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 5 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #13478
  • #13629

Powered by Codex Action

etraut-openai contributor · 5 months ago

This is part of #2109 which is partially implemented already, and more will be coming soon.

ttrenty · 5 months ago

This is great news, Thanks!!

janbam · 4 months ago

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 notify working well for agent-turn-complete with a local script that triggers notify-send plus a repeated sound. That solves the completion case.

The missing piece is approvals: tui.notifications = ["approval-requested"] can ring the terminal bell, but the external notify command 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"
  • cwd
  • thread-id
  • turn-id
  • approval kind / reason (command, file change, sandbox escalation, app tool, network, etc.)
  • a short preview where appropriate (command, changed path summary, host/protocol for network approvals)

A matching approval-resolved event would also be useful, but approval-requested is the critical one.

This would make background and semi-unattended Codex workflows much more practical.

AminDhouib · 2 months ago

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