Expose TUI question prompts ("Implement this plan?", reasoning scope, etc.) to the external hook system

Open 💬 6 comments Opened Apr 24, 2026 by RousselPaul
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Context

PR #17563 shipped PermissionRequest hooks for shell, unified exec, and network approvals. Thank you! We built a desktop overlay (Masko, related to #15311) that uses those hooks to show Allow/Deny cards outside the TUI.

There's one remaining class of prompt that we can't surface: TUI-internal question popups like "Implement this plan?", "Reasoning scope", and the request_user_input dialog chain.

The gap

Looking at codex-rs/tui/src/chatwidget.rs:

enum Notification {
    AgentTurnComplete { response: String },
    ExecApprovalRequested { command: String },
    EditApprovalRequested { cwd: PathBuf, changes: Vec<PathBuf> },
    ElicitationRequested { server_name: String },
    PlanModePrompt { title: String },   // ← invisible externally
}

PlanModePrompt fires on these TUI flows:

  • open_plan_implementation_prompt — "Implement this plan?"
  • Reasoning scope selection
  • A few other plan-mode dialogs

It dispatches through tui.notify() → OSC9/BEL escape sequences only. The legacy notify = ["..."] config in ~/.codex/config.toml (codex-rs/hooks/src/legacy_notify.rs) handles AgentTurnComplete but not PlanModePrompt. There's no external signal.

The preceding update_plan tool call does fire PostToolUse hooks, but it's an inference — there's no guarantee the popup will actually appear (other conditions like has_queued_follow_up_messages can suppress it).

Proposal

Any of these would unblock external UIs:

  1. Add a PermissionRequest variant for TUI questions — with tool_name: "request_user_input" or similar, carrying the title + option labels in tool_input. External hooks could respond with the picked option, same pattern as shell approvals.
  1. Add a new hook eventTuiQuestionOpened / TuiQuestionClosed, dispatched via the engine hooks alongside PreToolUse etc. Could be observability-only (no decision), which at least lets external UIs show the user "Codex needs you".
  1. Extend legacy_notify to fire for PlanModePrompt and ExecApprovalRequested too. Cheap, already-documented mechanism.

Option 1 is the most complete (matches the existing PermissionRequest contract). Option 2 is the smallest change that gives us visibility. Option 3 is the absolute minimum and keeps backward compat.

Related

  • #17563 (PermissionRequest hooks) — this is a natural extension, already listed as a follow-up item in that PR's description.
  • #15311 (original blocking-hook request from Masko).

Use case

Desktop overlays, remote observability, multi-agent orchestrators. Anything that wants to surface "Codex is waiting on the user" outside the TUI currently goes dark during plan-mode dialogs.

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 2 months ago

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

  • #16484

Powered by Codex Action

ma08 · 2 months ago

+1 badly need hook support for internal questions like plan approval and request_user_input etc.

the usecase i have is to receive whatsapp/email messages via hooks when working on a remote workspace

this picture has an overview of my remote workspace setup to use codex in a VM be pinged on whatsapp/email when it needs user input: https://github.com/ma08/botfiles/blob/main/docs/assets/readme/remote-development-stack.jpg

explained in this article: https://x.com/curious_queue/status/2049660997993152855?s=20

oxysoft · 2 months ago

Indexed this hook ticket in the umbrella tracker: #21753

Goal: collect the scattered Codex hook requests and bugs into one parity matrix for Full Claude Code Hook Parity (29+), while preserving this issue as the detailed thread for its specific behavior.

ma08 · 2 months ago
+1 badly need hook support for internal questions like plan approval and request_user_input etc. the usecase i have is to receive whatsapp/email messages via hooks when working on a remote workspace this picture has an overview of my remote workspace setup to use codex in a VM be pinged on whatsapp/email when it needs user input: https://github.com/ma08/botfiles/blob/main/docs/assets/readme/remote-development-stack.jpg explained in this article: https://x.com/curious_queue/status/2049660997993152855?s=20

i was able to temporarily circumvent this using the app server approach to track request_user_input event and do necessary actions (like sending message to update user about need for input etc): https://github.com/ma08/botfiles/pull/25

sharing in case this helps others

would still appreciate native hook support for events like this!

microHoffman · 2 months ago

+1 to implement this feature, it would be very much helpful also for detecting the session status for https://github.com/njbrake/agent-of-empires/issues/1126

brennanb2025 · 2 months ago

+1 This is a real integration blocker for us at Orca.

For external UIs/orchestrators, the lack of a hook for Codex sessions requesting user input leaves them incorrectly marked as working while they are actually blocked on the user. As it is now, the state contract is incomplete, as we can't distinguish "agent is actively working" from "agent is idle and waiting for human input."

This matters for:

  • dashboards showing agent status
  • remote sessions where the TUI is not visible
  • multi-agent orchestration
  • notifications / attention routing
  • timeout and stuck-agent detection

Any TUI prompt that blocks progress should emit a hook event, even if it's observability-only. A RequestUserInput event with title/options would be enough for integrations to mark the session as waiting and route attention correctly.