Skip to content

fix(agent-status): map codex request_user_input questions to Needs You - #9861

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/codex-request-user-input-waiting
Jul 22, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/codex-request-user-input-waiting

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

User report: on the agent dashboard (and the worktree sidebar — both read the same signal), a codex agent asking a question shows Idle; only permission asks reach Needs You.

Investigated against real codex v0.145.0 with a raw hook-capture rig:

  • Codex ≥0.145 has an experimental question tool, request_user_input (feature default_mode_request_user_input, flag name suggests it's headed for default-on). When the model asks a question, hooks emit PreToolUse with tool_name: "request_user_input" and no Stop — the turn stays open while the TUI waits on the answer. normalizeCodexEvent mapped every PreToolUse to working, so the pane showed a spinner (decaying to Idle) while codex was actually blocked on the user.
  • Answering emits PostToolUse (with the answers) then Stop — captured live.
  • Older codex (no tool): a question is a plain assistant message + Stop → Done/Idle. There is no event to map; behavior is intentionally unchanged.

Fix

  1. normalizeCodexEvent: PreToolUse whose tool is the question tool → waiting (exactly grok's ask_user_question mapping). PostToolUse/Stop already clear it.
  2. isAskUserQuestionTool now also matches request_user_input — this flows the questions JSON into interactivePrompt via the existing codex extractor, so the sidebar amber row, dashboard Needs You card + question chip, and native-chat card all light up with no further changes.
  3. Yolo suppressor exemption (shouldSuppressCodexAutoApprovalStatus): Orca launches codex with --dangerously-bypass-approvals-and-sandbox, and that suppressor drops all codex waiting/blocked statuses as auto-approval artifacts — it would have eaten the question wait. Question waits are user-actionable (yolo never auto-answers them), so they now bypass the suppressor. Synthetic-title suppression is unchanged (titles can't distinguish question from permission).
  4. Native-chat answer delivery: codex's question card is a digit-commit selector that ignores typed labels — live probe: pasting Blue + Enter committed "Red (Recommended)" (the highlighted first option), the STA-1860 misdelivery shape. Codex now uses option digits for direct choices plus a Codex-specific sequence for multi-question, skipped, and free-text-note answers; this avoids Claude's trailing submit Enter after Codex has already closed the overlay. Desktop and mobile share the same builder. Grok keeps the pasted-label path.

Version compatibility

  • Latest codex (0.145+, feature on): question → waiting → Needs You; answer → working → done. Verified live end-to-end.
  • Latest codex, feature off (current default): no request_user_input events — identical to today (verified live: model reports the tool unavailable; plain-text question + Stop → Done).
  • Older codex: never emits the tool; no behavior change. PermissionRequest waits unchanged.

Evidence (live QA, dev Orca + real codex v0.145.0, YOLO args + feature flag)

Dashboard: question in Needs You w/ chip dashboard
Sidebar: same pane "Waiting for input" sidebar
Yolo-attributed pane: wait survives suppressor yolo
  • Store entry during wait: state: waiting, tool: request_user_input, interactivePrompt: {"questions":[...]}; cleared on answer; done after Stop. Repeated across 4 question rounds.
  • Suppressor exemption falsification: registered real yolo launch attribution (matching provider session) on the live pane via the production registerAgentLaunchConfig path, re-triggered a question — the waiting status survived ingestion (pre-fix this exact configuration is dropped at the useIpcEvents suppressor gate).
  • Digit-commit proof: 2 alone answered "Blue"; paste-path proof of misdelivery above.

Tests

  • agent-hook-listener.test.ts: request_user_input lifecycle (waiting + interactivePrompt → working on answer → done), ordinary PreToolUse stays working.
  • codex-auto-approval-notification-suppression.test.ts: question wait not suppressed under yolo attribution (permission waits still are).
  • native-chat-agent-support / native-chat-interactive-prompt / desktop and mobile send suites: codex takes its selector-specific path, emits no post-submit Enter for multi-question answers, attaches custom text as notes, and confirms partial answers; grok keeps pasted text.

All: typecheck, oxlint (changed files), oxfmt, targeted vitest suites green. (lint:switch-exhaustiveness is red on main in skill-freshness-group.tsx — pre-existing, unrelated.)

Not covered / notes

  • Multi-question, skipped, and free-text-note Codex paths are source-verified against the v0.145 TUI state machine and covered by exact keystroke-sequence tests; only the single-choice path was live-probed end-to-end.
  • Codex emits no event on an interrupted question (Esc); the wait clears on the next real event, same exposure grok has today.

Codex 0.145 asks user questions via the auto-allowed request_user_input
tool (experimental default_mode_request_user_input): PreToolUse fires
while blocked on the answer with no Stop, so Orca showed the pane as
working/idle instead of Needs You. Map that PreToolUse to waiting
(mirrors grok's ask_user_question), exempt question waits from the codex
yolo auto-approval suppressor, and deliver native-chat answers to the
digit-commit selector by option number (typed labels are ignored and
Enter commits the highlighted first option). Older codex versions emit
no such event and are unchanged.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Codex request_user_input tools are recognized as ask-user interactions. Their lifecycle now transitions through waiting, working, and done states with interactive prompt data, and auto-approval suppression excludes these waits. Native chat answer handling now uses digit-commit keystrokes for Codex alongside Claude, while Grok retains pasted-label submission. Tests cover lifecycle normalization, notification behavior, and agent-specific routing.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is detailed, but it omits the required AI Review Report and Security Audit sections from the template. Add the missing AI Review Report and Security Audit sections, and confirm cross-platform review plus any remaining risks or follow-ups.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: mapping Codex request_user_input questions to Needs You.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025
brennanb2025 merged commit 0121f57 into main Jul 22, 2026
4 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
stablyai#9861)

* fix(agent-status): map codex request_user_input questions to waiting

Codex 0.145 asks user questions via the auto-allowed request_user_input
tool (experimental default_mode_request_user_input): PreToolUse fires
while blocked on the answer with no Stop, so Orca showed the pane as
working/idle instead of Needs You. Map that PreToolUse to waiting
(mirrors grok's ask_user_question), exempt question waits from the codex
yolo auto-approval suppressor, and deliver native-chat answers to the
digit-commit selector by option number (typed labels are ignored and
Enter commits the highlighted first option). Older codex versions emit
no such event and are unchanged.

* fix(native-chat): preserve codex question answer semantics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant