Skip to content

feat(review): auto-decide wait vs background by default (add --ask opt-in)#224

Open
awakia wants to merge 2 commits intoopenai:mainfrom
awakia:feat/review-auto-decide-default
Open

feat(review): auto-decide wait vs background by default (add --ask opt-in)#224
awakia wants to merge 2 commits intoopenai:mainfrom
awakia:feat/review-auto-decide-default

Conversation

@awakia
Copy link
Copy Markdown

@awakia awakia commented Apr 14, 2026

Summary

  • /codex:review no longer stops on AskUserQuestion by default. It sizes up the diff with the existing heuristic and auto-picks foreground (tiny, ~1-2 files) or background (everything else), so it can run unattended inside multi-step plans.
  • Adds an --ask flag for users who want the old interactive prompt back. --wait / --background still force a specific mode.
  • --ask is a Claude-side flag only; it is stripped from the argument string before handing off to codex-companion.mjs (which would otherwise reject it as unsupported focus text).

Why

Per #221, asking on every invocation defeats the purpose of embedding /codex:review in a plan: execution halts at the prompt and the user has to come back and click through it. The heuristic to decide wait vs background already lives in commands/review.md — this change just applies it automatically.

Test plan

  • /codex:review with no flags on a 1-file change → runs in foreground without asking
  • /codex:review with no flags on a large diff → launches in background without asking
  • /codex:review --ask → surfaces AskUserQuestion with recommended option suffixed (Recommended)
  • /codex:review --wait / --background → still force the chosen mode
  • /codex:review --ask--ask does not reach the companion script (no "unsupported focus text" error)

Closes #221

🤖 Generated with Claude Code

/codex:review now runs unattended by default: it sizes up the diff and
picks foreground for tiny changes (~1-2 files) or background otherwise,
instead of halting on AskUserQuestion. This unblocks multi-step plans
that embed /codex:review.

Users who want the old interactive prompt can pass --ask. --wait and
--background still force a specific mode. --ask is stripped before the
argument string is handed to codex-companion, which does not know about
it.

Closes openai#221

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@awakia awakia requested a review from a team April 14, 2026 09:18
Address Codex review findings on the initial patch:

1. /codex:review --ask previously fell through to the companion as
   positional focus text and failed with "unsupported focus text". Add
   `ask` to handleReviewCommand's booleanOptions so it is silently
   accepted, and drop the now-unnecessary "strip --ask" instructions
   from review.md. The flag is purely consumed by Claude's prompt
   logic; the companion just ignores it.

2. tests/commands.test.mjs still asserted the removed prompt phrases
   ("Recommend waiting only...", "In every other case..."). Update the
   assertions to match the new auto-decide wording and add coverage
   for the --ask branch and the new argument hint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

feat: /codex:review should not ask by default — auto-decide wait vs background

1 participant