codex - 💡(How to fix) Fix Expose effective approval reviewer to PermissionRequest hooks or support explicit defer [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#23465Fetched 2026-05-20 03:49:32
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×5commented ×1

Root Cause

External approval UIs and local observability tools need to avoid stealing approvals that Codex can already handle natively.

Right now permission_mode is not enough. In current hook input, permission_mode = "default" can represent both ordinary user approval and auto-review-backed approval. bypassPermissions is enough to identify full-access / no-approval mode, but there is no equivalent hook-level signal for auto-review.

Codex already exposes related state in other places:

  • app-server ThreadStartResponse / ThreadResumeResponse include approvalsReviewer
  • TurnStartParams accepts approvalsReviewer
  • app-server emits item/autoApprovalReview/started and item/autoApprovalReview/completed

Those are useful, but they do not solve the hook-time routing problem for a passive external UI that receives a PermissionRequest hook from an existing CLI/Desktop conversation. The hook needs either the effective per-turn reviewer, or a first-class way to say "I observed this request; continue with the native approval flow."

Code Example

{
  "hook_event_name": "PermissionRequest",
  "permission_mode": "default",
  "approvals_reviewer": "auto_review"
}

---

user | auto_review | guardian_subagent

---

{
  "hookSpecificOutput": {
    "hookEventName": "PermissionRequest",
    "decision": { "behavior": "defer_to_native" }
  }
}

---

{
  "approval_context": {
    "approvals_reviewer": "auto_review",
    "source": "turn"
  }
}
RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

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

What feature would you like to see?

Please expose the effective approval reviewer for the current turn in PermissionRequest hook input, or provide an explicit hook response that defers the request back to Codex's native approval path.

Today external approval UIs can observe and answer PermissionRequest hooks, but they cannot reliably tell whether a given request is supposed to be handled by the user directly or by Codex's native auto-review path.

A minimal hook payload addition could be:

{
  "hook_event_name": "PermissionRequest",
  "permission_mode": "default",
  "approvals_reviewer": "auto_review"
}

Possible values could match the existing app-server / config enum:

user | auto_review | guardian_subagent

Alternatively, support an explicit hook output such as:

{
  "hookSpecificOutput": {
    "hookEventName": "PermissionRequest",
    "decision": { "behavior": "defer_to_native" }
  }
}

or defer_to_user, if that naming better matches the internal approval model.

Why this matters

External approval UIs and local observability tools need to avoid stealing approvals that Codex can already handle natively.

Right now permission_mode is not enough. In current hook input, permission_mode = "default" can represent both ordinary user approval and auto-review-backed approval. bypassPermissions is enough to identify full-access / no-approval mode, but there is no equivalent hook-level signal for auto-review.

Codex already exposes related state in other places:

  • app-server ThreadStartResponse / ThreadResumeResponse include approvalsReviewer
  • TurnStartParams accepts approvalsReviewer
  • app-server emits item/autoApprovalReview/started and item/autoApprovalReview/completed

Those are useful, but they do not solve the hook-time routing problem for a passive external UI that receives a PermissionRequest hook from an existing CLI/Desktop conversation. The hook needs either the effective per-turn reviewer, or a first-class way to say "I observed this request; continue with the native approval flow."

Concrete use case

A desktop overlay or local approval daemon receives a PermissionRequest hook.

If the effective reviewer is user, it should show its own approval UI and return allow/deny.

If the effective reviewer is auto_review, it should not show a duplicate approval UI. It should defer immediately so Codex's native auto-review path can continue.

Without a reliable signal, external tools must choose between two bad options:

  • always intercept, which can duplicate or preempt Codex Auto Review
  • always defer, which loses the value of external approval UIs for normal user-reviewed requests

Suggested contract

The highest-value fix would be to add an advisory field to every PermissionRequest hook input:

{
  "approval_context": {
    "approvals_reviewer": "auto_review",
    "source": "turn"
  }
}

The source value is optional, but it would be useful to distinguish a real turn snapshot from global config defaults. The important part is that this should be the effective reviewer for the current request/turn, not only the user's global config preference.

If exposing the reviewer is not desirable, an explicit defer response would still help by giving hooks a documented no-decision path rather than relying on quiet output / implementation details.

Related issues / PRs

  • #21753 tracks broader hook parity and notes that PermissionRequest still needs a complete payload contract.
  • #15311 added the blocking PermissionRequest hook for external approval UIs.
  • #17997 proposed external approval reviewers and included an observability/defer use case.
  • #17564 explored passing guardian review context into PermissionRequest hooks.
  • #21975 discusses auto-review fallback behavior, which is adjacent to the same reviewer-routing boundary.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Expose effective approval reviewer to PermissionRequest hooks or support explicit defer [1 comments, 2 participants]