fix: resolve model aliases on review and adversarial-review - #688
Open
drewyd wants to merge 1 commit into
Open
Conversation
`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
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.
Fixes #687.
handleReviewCommandaccepts--model/-m(valueOptions: [..., "model", ...],aliasMap: { m: "model" }) but forwards the raw string toexecuteReviewRun→runAppServerReview→thread/start.normalizeRequestedModel()— the only thing that resolvesMODEL_ALIASES— is called solely inhandleTask.So the documented
sparkalias reaches the API as the literal stringspark:The message names the account as the cause, which is wrong and expensive to chase — the same account runs
--model gpt-5.3-codex-sparksuccessfully seconds later, andsparkwas never a model id. openai/codex#15648 is people landing on that sentence. The alias is documented for the runtime inskills/codex-cli-runtime/SKILL.md("Mapsparkto--model gpt-5.3-codex-spark") andagents/codex-rescue.md, with nothing marking it task-only.The change
Three lines of source: normalize in
handleReviewCommandthe wayhandleTaskalready does, so both command families resolve aliases identically. Coversreviewandadversarial-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 atthread/start. Addedstate.lastThreadStart, then one regression test per command mirroring the existingtask forwards model selection and reasoning effort to app-server turn/start.Both new tests fail on
mainwith exactly the reported bug:and pass with it.
Verification
node --test tests/*.test.mjson macOS 15 (arm64), Node 25,codex-cli0.149.1:main, untouchedThe 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-versionpasses; 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 (
--efforthas the same task-vs-review asymmetry, not addressed here).