Skip to content

Expose approval-requested event to external notify hook #14813

Closed

Description

@ttrenty

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

Activity

  1. added
    extensionIssues related to the VS Code extension
    sandboxIssues related to permissions or sandboxing
    on Mar 16, 2026
  2. github-actions commented on Mar 16, 2026

    @github-actions
    Contributor
  3. etraut-openai commented on Mar 16, 2026

    @etraut-openai
    Contributor

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

  4. ttrenty commented on Mar 16, 2026

    @ttrenty
    Author

    This is great news, Thanks!!

  5. janbam commented on Apr 1, 2026

    @janbam

    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.

  6. AminDhouib commented on Jun 28, 2026

    @AminDhouib

    We built a notification bridge that catches approval events and forwards them as push notifications. Works across Codex, Claude Code, and Cursor:

    Desktop.Notifications.for.Claude.Codex.Cursor.and.Gemini.-.AI.Agent.Notifier.Demo.mp4

    https://github.com/DevinoSolutions/ai-agent-notifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestextensionIssues related to the VS Code extensionsandboxIssues related to permissions or sandboxing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions