Skip to content

fix: resolve model aliases on review and adversarial-review - #688

Open
drewyd wants to merge 1 commit into
openai:mainfrom
drewyd:fix/review-model-alias
Open

fix: resolve model aliases on review and adversarial-review#688
drewyd wants to merge 1 commit into
openai:mainfrom
drewyd:fix/review-model-alias

Conversation

@drewyd

@drewyd drewyd commented Aug 26, 2026

Copy link
Copy Markdown

Fixes #687.

handleReviewCommand accepts --model/-m (valueOptions: [..., "model", ...], aliasMap: { m: "model" }) but forwards the raw string to executeReviewRunrunAppServerReviewthread/start. normalizeRequestedModel() — the only thing that resolves MODEL_ALIASES — is called solely in handleTask.

So the documented spark alias reaches the API as the literal string spark:

$ node scripts/codex-companion.mjs review --wait --scope working-tree --model spark
[codex] Codex error: {"type":"error","status":400,"error":{"type":"invalid_request_error",
"message":"The 'spark' model is not supported when using Codex with a ChatGPT account."}}

The message names the account as the cause, which is wrong and expensive to chase — the same account runs --model gpt-5.3-codex-spark successfully seconds later, and spark was never a model id. openai/codex#15648 is people landing on that sentence. The alias is documented for the runtime in skills/codex-cli-runtime/SKILL.md ("Map spark to --model gpt-5.3-codex-spark") and agents/codex-rescue.md, with nothing marking it task-only.

The change

Three lines of source: normalize in handleReviewCommand the way handleTask already does, so both command families resolve aliases identically. Covers review and adversarial-review, which share the handler.

Tests

The fake app-server recorded only turn/start, so nothing could observe the model on the review path — review sets the model at thread/start. Added state.lastThreadStart, then one regression test per command mirroring the existing task forwards model selection and reasoning effort to app-server turn/start.

Both new tests fail on main with exactly the reported bug:

✖ review resolves model aliases the same way task does
    actual: 'spark',
    expected: 'gpt-5.3-codex-spark',
✖ adversarial review resolves model aliases the same way task does
    actual: 'spark',
    expected: 'gpt-5.3-codex-spark',

and pass with it.

Verification

node --test tests/*.test.mjs on macOS 15 (arm64), Node 25, codex-cli 0.149.1:

tests pass fail
main, untouched 91 87 4
this branch 93 89 4

The same 4 fail before and after (status shows phases…, status preserves adversarial review kind labels, result returns the stored output…, resolveStateDir uses a temp-backed per-workspace directory) — pre-existing on a clean checkout in this environment, untouched by this change. npm run check-version passes; no version bump included, happy to add one if that is expected of contributor PRs.

Related: #654 (the flag is undocumented for these two commands — this PR does not change the docs, so that stays open), #651 / #476 (--effort has the same task-vs-review asymmetry, not addressed here).

`handleReviewCommand` accepted `--model`/`-m` but forwarded the raw string to
`executeReviewRun`, so `normalizeRequestedModel()` — the only thing that maps
`MODEL_ALIASES` — never ran on the review path. `--model spark` reached
`thread/start` as the literal `spark` and came back as:

  The 'spark' model is not supported when using Codex with a ChatGPT account.

which names the account as the cause when the account is fine and `spark` was
never a model id. The alias is documented for the runtime in
skills/codex-cli-runtime/SKILL.md and agents/codex-rescue.md with nothing
marking it task-only.

Normalize in `handleReviewCommand` the way `handleTask` already does, so both
command families resolve aliases identically.

Tests: the fake app-server now records the model it receives on `thread/start`
(it only recorded `turn/start`, so nothing could observe the review path), plus
a regression test per command mirroring the existing task-path one. Both fail
on main with `actual: 'spark', expected: 'gpt-5.3-codex-spark'`.

Fixes openai#687

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QdCdeAZa2tCJjFq69meyK9
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.

review / adversarial-review forward --model unnormalized, so the documented spark alias fails as "not supported when using Codex with a ChatGPT account"

1 participant