Expose approval-requested event to external notify hook

Resolved 💬 5 comments Opened Mar 16, 2026 by ttrenty Closed Mar 16, 2026

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 ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗