feat(review): auto-decide wait vs background by default (add --ask opt-in)#224
Open
awakia wants to merge 2 commits intoopenai:mainfrom
Open
feat(review): auto-decide wait vs background by default (add --ask opt-in)#224awakia wants to merge 2 commits intoopenai:mainfrom
awakia wants to merge 2 commits intoopenai:mainfrom
Conversation
/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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/codex:reviewno longer stops onAskUserQuestionby 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.--askflag for users who want the old interactive prompt back.--wait/--backgroundstill force a specific mode.--askis a Claude-side flag only; it is stripped from the argument string before handing off tocodex-companion.mjs(which would otherwise reject it as unsupported focus text).Why
Per #221, asking on every invocation defeats the purpose of embedding
/codex:reviewin 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 incommands/review.md— this change just applies it automatically.Test plan
/codex:reviewwith no flags on a 1-file change → runs in foreground without asking/codex:reviewwith no flags on a large diff → launches in background without asking/codex:review --ask→ surfacesAskUserQuestionwith recommended option suffixed(Recommended)/codex:review --wait/--background→ still force the chosen mode/codex:review --ask→--askdoes not reach the companion script (no "unsupported focus text" error)Closes #221
🤖 Generated with Claude Code