Skip to content

fix(review): accept positional focus text for parity with adversarial-review#523

Open
axisrow wants to merge 3 commits into
openai:mainfrom
axisrow:pr-522
Open

fix(review): accept positional focus text for parity with adversarial-review#523
axisrow wants to merge 3 commits into
openai:mainfrom
axisrow:pr-522

Conversation

@axisrow

@axisrow axisrow commented Jul 18, 2026

Copy link
Copy Markdown

What

Removes the unconditional focus-text rejection in /codex:review so it no longer aborts where /codex:adversarial-review succeeds.

Closes #522.

Why

/codex:review rejected any positional argument as "custom focus text" (validateNativeReviewRequest), while /codex:adversarial-review accepts it. Two sibling review commands behaved differently in a way the user only discovered by hitting the error, and the suggested escape hatch (adversarial-review) changes the review semantics — not a substitute for "let me name the model in my own words."

This also blocks non-English model/effort entry: even when a host (e.g. Claude Code reading the command's .md) rewrites a natural-language phrase into --model/--effort, any residual positional word still aborted the native review (see the Japanese example in #522).

Change

Remove the focus-text branch from validateNativeReviewRequest. The native reviewer (review/start) does not consume focus text, so leftover positional words are now silently ignored rather than rejecting the invocation. Review semantics are unchanged (still native structured-review via review/start); only the spurious abort is gone.

This PR does not add language/alias recognition in the companion — that stays the host's job. The fix is purely about interface parity: review no longer fails where adversarial-review succeeds.

Scope

This is independent of #471 — the two touch different concerns (#471 is model/effort negotiation + broker refresh; this is a review-command parity fix). Based on main so it can land on its own.

Testing

  • New runtime test review accepts (ignores) positional focus text for parity with adversarial-review (red before, green after).
  • Updated the stale review rejects focus text test and the commands.test.mjs assertion that pinned the old wording.
  • 0 regressions vs main (the pre-existing suite failures are unchanged).

🤖 Generated with Claude Code

…-review

Closes openai#522.

`/codex:review` unconditionally rejected any positional argument as
"custom focus text" (validateNativeReviewRequest), while
`/codex:adversarial-review` accepts it. That interface-parity gap also
blocked non-English model/effort entry: even when a host (e.g. Claude)
rewrites a natural-language phrase into `--model`/`--effort`, any
residual positional word still aborted the native review.

Remove the unconditional focus-text rejection. The native reviewer
(review/start) does not consume focus text, so leftover positional words
are now silently ignored rather than rejecting the invocation. Review
semantics are unchanged (still native structured-review); only the
spurious abort is gone.

Companion does no language/alias recognition — that is the host/.md
layer's job. This fix is purely about parity: review no longer fails
where adversarial-review succeeds.

Tested: runtime parity test (red before, green after), commands.test.mjs
assert updated to the new review.md wording. 0 regressions vs the openai#471
base (4 pre-existing fails unchanged).

Co-Authored-By: Claude <noreply@anthropic.com>
@axisrow
axisrow requested a review from a team July 18, 2026 10:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9b9481e97

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

);
}

function validateNativeReviewRequest(target, _focusText) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject unknown switches before ignoring focus text

Because parseArgs treats any unrecognized --... token as a positional, ignoring all focusText here also silently accepts typos or unsupported flags such as /codex:review --bas main or /codex:review --scoope branch; in those cases the command now runs a review against the auto-selected target instead of failing, which can give users a successful review of the wrong changes. Please distinguish real positional focus text from option-looking positionals before dropping it.

Useful? React with 👍 / 👎.

@axisrow

axisrow commented Jul 18, 2026

Copy link
Copy Markdown
Author

🔍 Local review (cycle 1)

Reviewed locally (Claude subagent + Codex companion), no bots pinged. Critical-only bar.

Verdict Reviewer Finding Location
SKIP claude Dead focusText local + vestigial _focusText param in the native-review branch (computed L366, passed to validator L369, used nowhere now) codex-companion.mjs:366,369

Codex companion: approve, 0 findings — "no critical security, data-loss, correctness, or performance defect is supported by the PR diff."

Claude subagent: 0 critical findings after verifying 6 claims against the code (focusText cannot leak into review/start RPC — payload is exactly {threadId, delivery, target}; cannot reach job metadata or rendered output; staged-only rejection still enforced; test is a genuine inversion, not a weakened assertion; parity-only scoping is sound).

No FIX verdicts → final cycle. The one SKIP (dead param) will be addressed in the cleanup pass or left as-is since it's harmless.

After the parity fix, focusText was computed unconditionally and passed
to validateNativeReviewRequest, which no longer reads it — dead in the
native branch (review/start ignores focus text). Scope focusText to the
adversarial branch (the only place it is used, via buildAdversarialReviewPrompt)
and drop the now-unused validator parameter. No behavior change.

Co-Authored-By: Claude <noreply@anthropic.com>
@axisrow

axisrow commented Jul 18, 2026

Copy link
Copy Markdown
Author

🔍 Local review (cycle 1, round 2 after cleanup commit)

Reviewed locally (Claude subagent + Codex companion), no bots pinged. Critical-only bar.

Verdict Reviewer Finding Location
SKIP claude validateRequest?.(target, focusText) still passes a now-dead 2nd arg (validator takes 1). Harmless — JS drops it. One-line cleanup. codex-companion.mjs:729

Codex companion: approve, 0 findings — "no defensible critical security, data-loss, correctness, or performance risk."

Claude subagent: 0 critical after verifying 6 claims against the code (native path never reads focusText; cleanup commit did NOT break the adversarial path — focusText still reaches buildAdversarialReviewPrompt; no leak into prompt/job metadata/logs; review --scope working-tree <leftover> runs native exit 0 without passing leftovers as instructions; tests are genuine inversions not weakened; pre-existing failures confirmed identical on main).

No FIX verdicts → final cycle. The one SKIP (dead 2nd arg) applied in the cleanup pass.

validateNativeReviewRequest(target) takes one arg after the parity fix, but
the call site still passed focusText as a second argument. Harmless (JS drops
it), but dead. Simplify to the single-arg call.

Co-Authored-By: Claude <noreply@anthropic.com>
axisrow added a commit to axisrow/codex-plugin-cc that referenced this pull request Jul 18, 2026
…rom openai#523)

Port the openai#523 review cleanups to fork-main: validateNativeReviewRequest
takes a single arg (the parity fix made focusText dead in the native branch),
the validateRequest call site no longer passes the dead 2nd arg, and
focusText is now scoped to the adversarial branch (the only reader, via
buildAdversarialReviewPrompt). No behavior change.

Co-Authored-By: Claude <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.

/codex:review rejects focus text — breaks interface parity with /codex:adversarial-review and blocks non-English model/effort entry

1 participant