Repository navigation
Conversation
|
Codex review: blocked before merge. What this changesThe branch routes unauthored GPT-5.4 Nano requests through the OpenAI Platform API, updates authentication coverage, restores Codex catalog imports, and carries unrelated release backports. Example: Run openai/gpt-5.4-nano with an inline API key, Codex enabled, and no authored base URL.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR retains a useful fix for behavior still present on current main, and the previous import finding is resolved. The protected security label and paired open issue also prevent closure; review coverage does not establish readiness for the unrelated release work. Priority: P2 Before merge
FindingsNone. Provenance
Tests
Agent review detailsHow this fits togetherOpenClaw's OpenAI plugin selects a model's transport and compatible credentials before the agent sends a request. The Platform API uses an API key, while the ChatGPT transport uses subscription authentication. flowchart TD
A[Selected model and operator settings] --> B[OpenAI route policy]
C[Observed model catalog] --> B
B --> D[Compatible credential selection]
D --> E[Platform API with API key]
D --> F[ChatGPT subscription transport]
E --> G[Agent reply or actionable error]
F --> G
Technical reviewBest possible solution: Apply the Nano catalog and route correction as a focused change on current main, preserving authored routes and existing credential ordering. Do we have a high-confidence way to reproduce the issue? Yes: current source establishes the missing Nano route contract and implicit Codex projection, and the contributor provides live stock-versus-patched comparisons. No current-main runtime was executed during this read-only review. Is this the best way to solve the issue? Yes for the focused Nano repair: it corrects the provider's implicit routing while preserving explicit transport choices. The unrelated release backports make the submitted integration less maintainable to review. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cfe61f23f927. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (25 earlier review cycles; latest 8 shown)
Reviewed October 8, 2026, 5:09 PM ET / 21:09 UTC (Revision 26). |
514f720 to
9dc7581
Compare
9dc7581 to
cd735c7
Compare
cd735c7 to
76d4663
Compare
68fc97c to
a076f62
Compare
Closes #148559
What Problem This Solves
Fixes:
openai/gpt-5.4-nanois rejected withConfigured openai authentication is not compatible with the selected model route.for every API-key credential whenplugins.entries.codexis enabled and nomodels.providers.openai.baseUrlorapiis authored, whilegpt-5.4-miniworks in the same configuration.User Impact
User impact:
gpt-5.4-nanoworks with an API key out of the box alongside the codex plugin, without authoring a base URL. With nothing authored, nano takes the Platform route: an API key is used for it whether or not a ChatGPT login is also present, and a ChatGPT login alone is refused before any request and reported bymodels status --checkas missing API-key auth, instead of being sent to the ChatGPT route, where OpenAI answersThe 'gpt-5.4-nano' model is not supported when using Codex with a ChatGPT account.An explicitopenai-chatgpt-responsesconfiguration still redirects nano, authored base URLs and observed ChatGPT routes resolve as before, and unknown custom ids under the codex runtime keep following the runtime onto the Codex transport.Billing, for release notes: a setup holding both a ChatGPT login and an OpenAI API key now sends unauthored nano requests to the Platform API on that key, which is billed per token. Before this change the same setup sent nano to the ChatGPT route, where OpenAI refuses it with a 400 (Evidence below), so no nano request in that setup was ever served or billed; it moves from a guaranteed failure to a billed success. An operator who does not want nano billed on the key can leave nano out of their model list.
Why This Change Was Made
Nano is in
OPENAI_PROVIDER_MODERN_MODEL_IDSand deliberately excluded fromOPENAI_CHATGPT_MODERN_MODEL_IDS, but it sits in none of the static route sets, and every guard in the provider that means "not on ChatGPT" is spelledisOpenAIPlatformOnlyRouteModelId, so nano fell between the two lists. Two of those guards put it on the Codex transport whenever the codex plugin entry is enabled: the offline ChatGPT catalog (buildOpenAICodexStaticProviderConfig) listed it, andshouldResolveDynamicModelThroughCodexprojected it onto the Codex Responses transport under the codex runtime. That row became the model's only observed route,resolveModelRoutesreturned a subscription-only route, andselectProviderModelRouteAuthrejected the API key as incompatible.The change keeps nano contract-less, which the existing policy tests rely on (
groups reversed physical routes for unknown logical model gpt-5.4-nano,preserves explicit ChatGPT routes for known model contracts), and stops only the implicit projections: the offline ChatGPT catalog lists ids with a subscription contract (isOpenAIChatGPTModernModelId), and a first-party id outside that catalog stays on the Platform transport under the codex runtime. Without the codex entry the model resolvedindeterminateinstead, which the auth planner tolerates at run time butmodels status --checkreports asAuth readiness could not be confirmed; a first-party modern id with nothing authored now resolves to the Platform route, including when the manifest catalog's own Platform row is observed, while unknown custom ids keep deferring to observation or config.The route-contract alignment test filtered the modern ids through the three membership predicates, so an id in no set was skipped rather than failed. It now also asserts that every modern id resolves to routes with nothing authored or observed.
Review follow-up: earlier revisions offered nano both routes under the subscription preference, so an OAuth-only setup would keep the ChatGPT route the offline catalog used to give it. A run with a real ChatGPT login (below) shows that route cannot serve nano: the turn reaches OpenAI authenticated on the subscription route and gets a 400,
The 'gpt-5.4-nano' model is not supported when using Codex with a ChatGPT account., which matches nano's exclusion fromOPENAI_CHATGPT_MODERN_MODEL_IDS. An OAuth-only nano setup therefore never got a reply, before or after this change, and the subscription preference sent a setup holding both credentials to the same refusal. Unauthored nano now takes the Platform route alone: an OAuth-only setup fails locally withNo route-compatible authentication source is configured for openai.and a clearmodels status --checkissue, and a setup holding both uses its API key.Evidence
OAuth-only nano with a real ChatGPT login
Head eb0bfe0 (both routes offered), built from source on a 4 vCPU Linux host. Fresh throwaway state holding only a ChatGPT OAuth profile (account id present),
OPENAI_API_KEYunset, codex plugin enabled, no base URL, one embeddedopenclaw agent --localturn withopenai/gpt-5.4-nanoas primary. The credential copy was deleted after the run; the profile id is elided:Route selection accepted the OAuth profile and the request went out authenticated, so the refusal is OpenAI's, not a local one. This is why the current head gives unauthored nano the Platform route alone.
Tests for that change, red with the source at the previous head and green after:
Matched real-gateway A/B at head c1c5867
Stock
aa9b92a12d8(this branch's merge base) against headc1c58679d48, both built from source on an Apple Silicon macOS host, one throwaway config per case: codex plugin enabled, no base URL, oneopenclaw agent --jsonturn through a loopback Gateway, prompt "Reply with the single word OK.". The API key is real and written only to the throwaway config. The subscription profile is a fake token added withmodels auth paste-token, so a subscription route shows up as a turn that gets past route selection and stops at the Codex app-server credential check, instead of being rejected before any request.Configured openai authentication is not compatible with the selected model route.OKOKOKCodex app-server auth profile "openai:manual" is missing its ChatGPT account ID.The API-key case goes from a local route rejection to a real response, with mini unchanged. The token-only and both-credential cases take the subscription route on both builds and stop at the same credential check, so neither the OAuth-only route nor the subscription preference changed. The fake token stops before OpenAI; the real-login run above shows the final ChatGPT request. At the current head the token-only nano row is refused before any request and the both-credential row uses the API key, as the planner tests above pin.
Two notes on the harness:
agent --localin these builds failed withDetached task runtime owner changed before task settlement.for mini on both builds and for patched nano, an unrelated local-mode failure, so the Gateway rows are the comparison (stock nano under--localstill showed the route rejection before any request). And with the key supplied as an env SecretRef instead of inline, stock nano already reached OpenAI in an earlier run, so the rejection is specific to the inline-key shape the issue reports.Review follow-up tests, red with the source at the previous head and green after:
Original reproduction
Live A/B through the real embedded-run entry point,
extensions/openai/scripts/repro-148559.sh(throwaway state dir, inline API key, no base URL,plugins.entries.codex.enabled, fake key on purpose so the question is whether the request reaches OpenAI at all):Stock rejects nano before any request; patched sends the request and gets OpenAI's 401 for the fake key, identical to mini.
The same script with a real key (
OPENAI_REPRO_API_KEY, written only to the throwaway config), prompt "Reply with the single word OK.":extensions/openai/openai-provider.test.ts
× keeps the offline ChatGPT catalog to ids with a subscription contract
→ expected [ 'gpt-5.6-sol', 'gpt-5.5', …(5) ] to not include 'gpt-5.4-nano'
× keeps a first-party id outside the ChatGPT catalog on the Platform transport under the Codex runtime
→ expected { provider: 'openai', …(11) } to match object { id: 'gpt-5.4-nano', …(2) }
extensions/openai/model-route-contract.test.ts
× routes a contract-less modern id to the Platform API without an authored base URL
→ expected { kind: 'indeterminate', …(1) } to match object { kind: 'routes', …(2) }
× keeps route eligibility aligned with both provider runtime surfaces
→ expected { kind: 'indeterminate', …(1) } to match object { kind: 'routes' }