Skip to content

PermissionRequest hooks need a user-facing approval signal for passive notifications #28833

Open

Description

@me-hoy-minoy

What variant of Codex are you using?

Codex CLI and Codex Desktop / app-server approval flows.

Locally observed with:

  • codex-cli 0.139.0
  • Codex Desktop 26.611.62324 on macOS

What feature would you like to see?

Please expose whether a PermissionRequest hook corresponds to an approval prompt that actually requires user attention, or add a separate post-routing hook/event for user-facing approval prompts.

A concrete version of the request would be one of:

  1. Add the effective approval reviewer to PermissionRequest input, e.g. approvals_reviewer: "user" | "auto_review" | "guardian_subagent".
  2. Add a direct routing field, e.g. approval_route: "user" | "auto_review", or requires_user_input: true.
  3. Add a separate post-routing event/hook such as UserApprovalRequest / ApprovalPromptShown that fires only when Codex is actually waiting on the user.

Why this matters

I have a PermissionRequest command hook in ~/.codex/hooks.json that invokes a local notification script. The script uses terminal-notifier on macOS to play a sound and show a notification like "Codex needs permission" with the requested tool name.

When approval reviewer is set to auto_review / "Approve for me", the hook still fires before Codex routes the approval through auto-review. The result is a false positive notification for requests that the automated reviewer can handle without human input.

From the user's perspective, the notification says Codex needs permission, but no user action is actually needed.

The current hook payload does not appear to provide a reliable way to suppress these notifications. permission_mode is still default, and there is no approvals_reviewer, approval_route, or requires_user_input field.

Expected behavior

A passive notification integration should be able to notify only when Codex is actually waiting for the user.

This differs from an external approval UI that wants to decide allow/deny. The hook is not trying to intercept or replace the approval decision. It only wants to notify when attention is required.

Current workaround

The current options are imperfect:

  • Use PermissionRequest, which fires too early and includes auto-reviewed requests.
  • Use TUI notifications = ["approval-requested"], which is useful but does not provide the same custom command/icon/sound behavior as an external notification script and does not cover every external integration shape.
  • Build an app-server/protocol watcher for later approval request events, which is more complex and less appropriate for a simple user hook.

Related

This overlaps with #23465, which asks to expose the effective approval reviewer to PermissionRequest hooks or support explicit defer. This issue is the passive notification use case for the same missing routing signal.

Activity

  1. added
    enhancement
    CLI
    app
    hooks
    app-server
    on Jun 18, 2026
  2. AminDhouib commented on Jun 28, 2026

    @AminDhouib

    Until there is a native signal for this, we built a notification daemon that detects permission requests and pushes to phone or desktop. Supports Codex, Claude Code, and Cursor.

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

  3. raine commented on Aug 29, 2026

    @raine

    Workmux hits the same problem. We currently map PermissionRequest to a waiting status, so automatic review creates a false attention signal: raine/workmux#262.

    reviewer would cover automatic review, but a post-routing event is still the reliable signal since hooks or cached approvals can resolve a user-routed request before any prompt appears.

  4. Tomodo1773 commented on Sep 11, 2026

    @Tomodo1773

    I'm hitting this too. I use a PermissionRequest hook to play a local sound when Codex needs me, but auto-reviewed requests still trigger it even though no action is required. It gets especially noisy when a task is split across multiple subagents: unrelated requests can produce a burst of sounds even when Codex isn't waiting for me.

  5. YeChengzhi commented on Nov 24, 2026

    @YeChengzhi

    I can reproduce this with Glance 0.3.4 and Codex in the ChatGPT desktop app (26.1120.41243, macOS arm64). Glance shows Codex activity on a separate desk display.

    Steps to reproduce

    1. Enable Glance’s Codex integration so its observer runs on PermissionRequest.
    2. Open a Codex desktop chat and select Approve for me.
    3. Run a task that produces an approval request eligible for automatic review, such as a shell command that needs to run outside the workspace sandbox.
    4. Let Auto-review approve the request. Repeat with a task that produces several such requests.

    Actual behavior

    Glance repeatedly shows “Approve on computer” even though Codex handles the requests automatically and never asks me to click Approve. The display briefly looks like Codex is blocked and waiting for me.

    Requested behavior

    Add a passive hook that fires when Codex starts waiting for a human to approve an action or answer a question. Include a corresponding end-of-wait event or state so the display can clear the alert when the request is answered, cancelled, or otherwise resolved. Requests handled by Auto-review should produce no human-attention alert.

    The existing App Server states waitingOnApproval and waitingOnUserInput are a useful reference. In an isolated test using the bundled App Server and the actual Glance binary, forwarding those states produced alerts for manual approval and questions, including questions under Approve for me. Automatically approved and denied commands produced no Glance alert. This integration only needs to display status. Codex would continue to handle approvals and answers.

  6. ffaubert commented on Nov 30, 2026

    @ffaubert

    Adding a concrete case for this. PermissionRequest runs before the approvals reviewer: core/src/tools/approvals.rs request_approval_with_user_prompt calls run_permission_request_hooks, then request_reviewer_approval → request_guardian_approval, and falls back to user_prompt only when Guardian returns None (AskUser, a disabled Guardian scope, or InputBudgetExceeded). The hook doesn't run again at that point, and its input has no reviewer field. So with approvals_reviewer = "auto_review", a hook can't tell the requests the person must answer from the ones Guardian will handle: it can answer all of them before Guardian runs, or none.

    We relay approvals to the person's phone (only calls Codex was about to ask them about), so today our hook abstains whenever the reviewer is on. What would fix it: a hook that fires right before the user prompt is emitted (request_user_approval), with PermissionRequest's input plus approval_id and a reason (policy, reviewer_ask_user, review_unavailable, managed_checkpoint). It could return allow or deny for non-checkpoint requests and race the native prompt (first answer wins, as app-server clients already do via serverRequest/resolved). Its timing would then match Claude Code's PermissionRequest. Related: #23465, #39447, #39835, #62039.

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

    CLIappapp-serverenhancementhooks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions