Repository navigation
fix(openai): show newer subscription models in the picker - #200811
Conversation
OpenClaw-Publication: e47dc3ad-1f2d-8ea4-ae97-f686564c74ef
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR requests the broader ChatGPT subscription catalog using client_version=99.0.0 independently of the executing Codex version. Example: A ChatGPT subscriber refreshes models while using Codex 0.164.0.
Review scores
ProductKind: Preference · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a deliberate, narrowly scoped model-discovery policy change, with no definite introduced code defect found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe OpenAI provider turns authenticated, account-scoped backend catalog responses into picker rows; Codex separately selects the binary that executes turns. flowchart LR
A[ChatGPT credential] --> B[OpenAI provider discovery]
B --> C[Broad subscription catalog]
C --> D[Account scoped picker rows]
D --> E[Selected model]
E --> F[Codex turn runtime]
Technical reviewBest possible solution: Keep the broader subscription query in the existing provider catalog owner while leaving runtime selection and Platform access-program discovery with their existing owners. Do we have a high-confidence way to reproduce the issue? Current-main source reports the selected runtime version, and the author reports that changing this parameter changed the same account's returned catalog; no independent product reproduction was run. Is this the best way to solve the issue? The patch is the smallest implementation of the accepted visibility policy: it changes the existing subscription request without adding configuration, runtime machinery, or another catalog owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b255cc584c9b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -6, Tests +2, Docs -15. Total -19 across 7 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 Reviewed November 17, 2026, 5:11 PM ET / 22:11 UTC. |
…w release (#201130) ## What Problem This Solves Fixes: new OpenAI models (for example GPT-6.2) do not appear in the picker for ChatGPT subscription logins until a new OpenClaw release ships. ## User Impact User impact: a newly launched OpenAI subscription model appears in the picker within six hours of OpenAI publishing the Codex release that supports it, without an OpenClaw update. The OpenClaw harness runs it at once. A Codex-harness turn on a model its Codex binary is too old for now fails with a clear message: `<model> needs a newer Codex than <version>. Update your global Codex with "npm i -g @openai/codex", then restart the Gateway. Or choose another model.` In Control UI, that failure offers **Start a new session**: a session on the OpenClaw harness, same agent and model, that asks the agent to run the update. OpenClaw itself never installs or updates Codex. Channels show the text instructions. ## Why This Change Was Made ChatGPT's subscription model list (`/backend-api/codex/models`) hides each model from clients whose `client_version` is below the model's minimum Codex version. OpenClaw reported its bundled or installed Codex version, so every new model waited for an OpenClaw release (or a manual Codex upgrade plus restart). The OpenAI plugin now lists as the newest stable `@openai/codex` on npm, cached for six hours and never below the bundled pin. If the registry read fails, it lists as the bundled pin and retries on the next listing. The Codex harness still runs only its own binary. When that binary is too old, the native `model_not_found` error becomes the actionable message above, at the one existing mapping point (`resolveCodexPromptError`). Compared with the reverted #200811 (`client_version=99.0.0`): this reports a real published Codex version, so it lists only models some released Codex can run, and the update instructions always resolve the failure. The shared tradeoff (a Codex harness older than npm latest can see a model it cannot run) is intentional; `src/plugins/AGENTS.md` and `src/agents/AGENTS.md` now state it. The Codex error is a host-owned `AgentHarnessRuntimeUpdateRequiredError` (code `harness_update_required`), which the run-failure notice keeps so Control UI can offer the new session. The update instruction names the Codex the turn ran: global npm (`npm i -g @openai/codex`), the ChatGPT desktop app's Codex (desktop-first), the path set by `plugins.entries.codex.config.appServer.command` or `OPENCLAW_CODEX_APP_SERVER_BIN`, or the remote app-server. A new session started from an incognito conversation is incognito too. This removes the earlier "report the selected Codex binary" path: the parent-to-worker version handoff, the private-local SDK facade `plugin-sdk/codex-client-version-runtime`, and `extensions/codex/client-version-api.ts`. Net: 60 files, +1205 / −936 against the merge base; about 350 of those lines are existing tests moved verbatim to a sibling file. Control UI chat boot: base `6ec27bd739c7` is already over the request ceiling (21 requests > 20, 1,331,855 B gzip); this change adds 198 B gzip and no request. The new session's creation code loads lazily through the existing `createSession` runtime import. ## Evidence - **Focused tests (green on the final head):** `extensions/openai/openai-codex-discovery.test.ts`, `extensions/openai/openai-provider.test.ts`, `extensions/openai/openai-provider.codex-catalog.test.ts` (ChatGPT OAuth catalog cases moved verbatim from `openai-provider.test.ts` for the line cap), `extensions/openai/base-url.test.ts`, `extensions/codex/src/app-server/event-projector.terminal-errors.test.ts` (also red on the merge base), `extensions/codex/src/app-server/managed-binary.test.ts`, `extensions/codex/src/app-server/bounded-turn.test.ts`, `extensions/codex/src/app-server/isolated-completion.native.test.ts`, `src/agents/prepared-model-catalog-worker.test.ts`, `test/scripts/codex-client-version-contract.test.ts`. `tsgo:core`, `tsgo:extensions`, `tsgo:extensions:test` pass. - **Red on base, green with fix:** `src/plugins/contracts/provider-live-listing.contract.test.ts` › "OpenAI subscription models list and run without a release" fails on the merge base (`expected [] to include 'contract-probe-chat-1'`) and passes on this branch. - **End to end, isolated Gateway from source with a real ChatGPT login:** - Model-list URL resolved to `…/models?client_version=0.170.0` (npm latest at test time; bundled pin is 0.169.0). - `models.list` showed `gpt-6.2-astra` and `gpt-6.2-sol` for an OpenClaw-harness agent and a Codex-harness agent. - A real `openai/gpt-6.2-sol` turn returned `ok` on each harness; session entries record `agentHarnessId` `openclaw` and `codex`. - With an explicit Codex 0.164.0 app-server binary, the Codex-harness turn failed with: `gpt-6.2-sol needs a newer Codex than 0.164.0. Update your global Codex with "npm i -g @openai/codex", then restart the Gateway. Or choose another model.` - **Start a new session, end to end** (same Gateway, Codex 0.164.0, real Control UI). The before shot is from the unchanged base UI `6ec27bd739c7`; after shots are from this branch's build: - Before: the update failure offers only Try again. - After: the same failure offers **Start a new session**. Clicking it opened a session on the OpenClaw harness with `gpt-6.2-sol`; the agent ran the update with its normal exec tool, reported `codex-cli 0.170.0`, and said the Gateway must restart to select it. - **Focused tests for the button and notice:** `ui/src/pages/chat/components/chat-run-failure-notice.test.ts` (10), `src/sessions/session-run-error.test.ts` (10), `extensions/codex/src/app-server/event-projector.terminal-errors.test.ts` (41), `src/gateway/server-chat.native-provider-error.test.ts` (7). `tsgo:core`, `tsgo:ui`, `tsgo:extensions`, `tsgo:extensions:test`, oxlint and the line-cap ratchet pass on `670e3c7a8e`. Co-authored-by: Ayaan Zaidi <[email protected]>
…w release (openclaw#201130) ## What Problem This Solves Fixes: new OpenAI models (for example GPT-6.2) do not appear in the picker for ChatGPT subscription logins until a new OpenClaw release ships. ## User Impact User impact: a newly launched OpenAI subscription model appears in the picker within six hours of OpenAI publishing the Codex release that supports it, without an OpenClaw update. The OpenClaw harness runs it at once. A Codex-harness turn on a model its Codex binary is too old for now fails with a clear message: `<model> needs a newer Codex than <version>. Update your global Codex with "npm i -g @openai/codex", then restart the Gateway. Or choose another model.` In Control UI, that failure offers **Start a new session**: a session on the OpenClaw harness, same agent and model, that asks the agent to run the update. OpenClaw itself never installs or updates Codex. Channels show the text instructions. ## Why This Change Was Made ChatGPT's subscription model list (`/backend-api/codex/models`) hides each model from clients whose `client_version` is below the model's minimum Codex version. OpenClaw reported its bundled or installed Codex version, so every new model waited for an OpenClaw release (or a manual Codex upgrade plus restart). The OpenAI plugin now lists as the newest stable `@openai/codex` on npm, cached for six hours and never below the bundled pin. If the registry read fails, it lists as the bundled pin and retries on the next listing. The Codex harness still runs only its own binary. When that binary is too old, the native `model_not_found` error becomes the actionable message above, at the one existing mapping point (`resolveCodexPromptError`). Compared with the reverted openclaw#200811 (`client_version=99.0.0`): this reports a real published Codex version, so it lists only models some released Codex can run, and the update instructions always resolve the failure. The shared tradeoff (a Codex harness older than npm latest can see a model it cannot run) is intentional; `src/plugins/AGENTS.md` and `src/agents/AGENTS.md` now state it. The Codex error is a host-owned `AgentHarnessRuntimeUpdateRequiredError` (code `harness_update_required`), which the run-failure notice keeps so Control UI can offer the new session. The update instruction names the Codex the turn ran: global npm (`npm i -g @openai/codex`), the ChatGPT desktop app's Codex (desktop-first), the path set by `plugins.entries.codex.config.appServer.command` or `OPENCLAW_CODEX_APP_SERVER_BIN`, or the remote app-server. A new session started from an incognito conversation is incognito too. This removes the earlier "report the selected Codex binary" path: the parent-to-worker version handoff, the private-local SDK facade `plugin-sdk/codex-client-version-runtime`, and `extensions/codex/client-version-api.ts`. Net: 60 files, +1205 / −936 against the merge base; about 350 of those lines are existing tests moved verbatim to a sibling file. Control UI chat boot: base `c1e069592f92` is already over the request ceiling (21 requests > 20, 1,331,855 B gzip); this change adds 198 B gzip and no request. The new session's creation code loads lazily through the existing `createSession` runtime import. ## Evidence - **Focused tests (green on the final head):** `extensions/openai/openai-codex-discovery.test.ts`, `extensions/openai/openai-provider.test.ts`, `extensions/openai/openai-provider.codex-catalog.test.ts` (ChatGPT OAuth catalog cases moved verbatim from `openai-provider.test.ts` for the line cap), `extensions/openai/base-url.test.ts`, `extensions/codex/src/app-server/event-projector.terminal-errors.test.ts` (also red on the merge base), `extensions/codex/src/app-server/managed-binary.test.ts`, `extensions/codex/src/app-server/bounded-turn.test.ts`, `extensions/codex/src/app-server/isolated-completion.native.test.ts`, `src/agents/prepared-model-catalog-worker.test.ts`, `test/scripts/codex-client-version-contract.test.ts`. `tsgo:core`, `tsgo:extensions`, `tsgo:extensions:test` pass. - **Red on base, green with fix:** `src/plugins/contracts/provider-live-listing.contract.test.ts` › "OpenAI subscription models list and run without a release" fails on the merge base (`expected [] to include 'contract-probe-chat-1'`) and passes on this branch. - **End to end, isolated Gateway from source with a real ChatGPT login:** - Model-list URL resolved to `…/models?client_version=0.170.0` (npm latest at test time; bundled pin is 0.169.0). - `models.list` showed `gpt-6.2-astra` and `gpt-6.2-sol` for an OpenClaw-harness agent and a Codex-harness agent. - A real `openai/gpt-6.2-sol` turn returned `ok` on each harness; session entries record `agentHarnessId` `openclaw` and `codex`. - With an explicit Codex 0.164.0 app-server binary, the Codex-harness turn failed with: `gpt-6.2-sol needs a newer Codex than 0.164.0. Update your global Codex with "npm i -g @openai/codex", then restart the Gateway. Or choose another model.` - **Start a new session, end to end** (same Gateway, Codex 0.164.0, real Control UI). The before shot is from the unchanged base UI `c1e069592f92`; after shots are from this branch's build: - Before: the update failure offers only Try again. - After: the same failure offers **Start a new session**. Clicking it opened a session on the OpenClaw harness with `gpt-6.2-sol`; the agent ran the update with its normal exec tool, reported `codex-cli 0.170.0`, and said the Gateway must restart to select it. - **Focused tests for the button and notice:** `ui/src/pages/chat/components/chat-run-failure-notice.test.ts` (10), `src/sessions/session-run-error.test.ts` (10), `extensions/codex/src/app-server/event-projector.terminal-errors.test.ts` (41), `src/gateway/server-chat.native-provider-error.test.ts` (7). `tsgo:core`, `tsgo:ui`, `tsgo:extensions`, `tsgo:extensions:test`, oxlint and the line-cap ratchet pass on `670e3c7a8e`. Co-authored-by: Ayaan Zaidi <[email protected]>
…w release (#201130) Fixes: new OpenAI models (for example GPT-6.2) do not appear in the picker for ChatGPT subscription logins until a new OpenClaw release ships. User impact: a newly launched OpenAI subscription model appears in the picker within six hours of OpenAI publishing the Codex release that supports it, without an OpenClaw update. The OpenClaw harness runs it at once. A Codex-harness turn on a model its Codex binary is too old for now fails with a clear message: `<model> needs a newer Codex than <version>. Update your global Codex with "npm i -g @openai/codex", then restart the Gateway. Or choose another model.` In Control UI, that failure offers **Start a new session**: a session on the OpenClaw harness, same agent and model, that asks the agent to run the update. OpenClaw itself never installs or updates Codex. Channels show the text instructions. ChatGPT's subscription model list (`/backend-api/codex/models`) hides each model from clients whose `client_version` is below the model's minimum Codex version. OpenClaw reported its bundled or installed Codex version, so every new model waited for an OpenClaw release (or a manual Codex upgrade plus restart). The OpenAI plugin now lists as the newest stable `@openai/codex` on npm, cached for six hours and never below the bundled pin. If the registry read fails, it lists as the bundled pin and retries on the next listing. The Codex harness still runs only its own binary. When that binary is too old, the native `model_not_found` error becomes the actionable message above, at the one existing mapping point (`resolveCodexPromptError`). Compared with the reverted #200811 (`client_version=99.0.0`): this reports a real published Codex version, so it lists only models some released Codex can run, and the update instructions always resolve the failure. The shared tradeoff (a Codex harness older than npm latest can see a model it cannot run) is intentional; `src/plugins/AGENTS.md` and `src/agents/AGENTS.md` now state it. The Codex error is a host-owned `AgentHarnessRuntimeUpdateRequiredError` (code `harness_update_required`), which the run-failure notice keeps so Control UI can offer the new session. The update instruction names the Codex the turn ran: global npm (`npm i -g @openai/codex`), the ChatGPT desktop app's Codex (desktop-first), the path set by `plugins.entries.codex.config.appServer.command` or `OPENCLAW_CODEX_APP_SERVER_BIN`, or the remote app-server. A new session started from an incognito conversation is incognito too. This removes the earlier "report the selected Codex binary" path: the parent-to-worker version handoff, the private-local SDK facade `plugin-sdk/codex-client-version-runtime`, and `extensions/codex/client-version-api.ts`. Net: 60 files, +1205 / −936 against the merge base; about 350 of those lines are existing tests moved verbatim to a sibling file. Control UI chat boot: base `6ec27bd739c7` is already over the request ceiling (21 requests > 20, 1,331,855 B gzip); this change adds 198 B gzip and no request. The new session's creation code loads lazily through the existing `createSession` runtime import. - **Focused tests (green on the final head):** `extensions/openai/openai-codex-discovery.test.ts`, `extensions/openai/openai-provider.test.ts`, `extensions/openai/openai-provider.codex-catalog.test.ts` (ChatGPT OAuth catalog cases moved verbatim from `openai-provider.test.ts` for the line cap), `extensions/openai/base-url.test.ts`, `extensions/codex/src/app-server/event-projector.terminal-errors.test.ts` (also red on the merge base), `extensions/codex/src/app-server/managed-binary.test.ts`, `extensions/codex/src/app-server/bounded-turn.test.ts`, `extensions/codex/src/app-server/isolated-completion.native.test.ts`, `src/agents/prepared-model-catalog-worker.test.ts`, `test/scripts/codex-client-version-contract.test.ts`. `tsgo:core`, `tsgo:extensions`, `tsgo:extensions:test` pass. - **Red on base, green with fix:** `src/plugins/contracts/provider-live-listing.contract.test.ts` › "OpenAI subscription models list and run without a release" fails on the merge base (`expected [] to include 'contract-probe-chat-1'`) and passes on this branch. - **End to end, isolated Gateway from source with a real ChatGPT login:** - Model-list URL resolved to `…/models?client_version=0.170.0` (npm latest at test time; bundled pin is 0.169.0). - `models.list` showed `gpt-6.2-astra` and `gpt-6.2-sol` for an OpenClaw-harness agent and a Codex-harness agent. - A real `openai/gpt-6.2-sol` turn returned `ok` on each harness; session entries record `agentHarnessId` `openclaw` and `codex`. - With an explicit Codex 0.164.0 app-server binary, the Codex-harness turn failed with: `gpt-6.2-sol needs a newer Codex than 0.164.0. Update your global Codex with "npm i -g @openai/codex", then restart the Gateway. Or choose another model.` - **Start a new session, end to end** (same Gateway, Codex 0.164.0, real Control UI). The before shot is from the unchanged base UI `6ec27bd739c7`; after shots are from this branch's build: - Before: the update failure offers only Try again. - After: the same failure offers **Start a new session**. Clicking it opened a session on the OpenClaw harness with `gpt-6.2-sol`; the agent ran the update with its normal exec tool, reported `codex-cli 0.170.0`, and said the Gateway must restart to select it. - **Focused tests for the button and notice:** `ui/src/pages/chat/components/chat-run-failure-notice.test.ts` (10), `src/sessions/session-run-error.test.ts` (10), `extensions/codex/src/app-server/event-projector.terminal-errors.test.ts` (41), `src/gateway/server-chat.native-provider-error.test.ts` (7). `tsgo:core`, `tsgo:ui`, `tsgo:extensions`, `tsgo:extensions:test`, oxlint and the line-cap ratchet pass on `670e3c7a8e`. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 1680f54) Release adaptation: Preserve baseline send actions, notice props, and performance budget; add only update recovery wiring. Omit unrelated plugin feedback and model-specific documentation example. Visual and bundle proof remain required at integration.: Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 9e29cd77014f2b4aeba321bef371a24bafe5915c)
What Problem This Solves
Refreshing models with a ChatGPT subscription can omit models already listed for the same account because the discovery request reports an older Codex version.
User Impact
Subscription discovery can show newer models without changing the bundled or installed Codex. The picker can now show a model an older Codex runtime cannot run; discovery does not guarantee inference compatibility.
Why This Change Was Made
Send
client_version=99.0.0only for the authenticated subscription catalog request. Keep account scoping, visibility, the Platform access-program request, Sign in with ChatGPT, and turn execution unchanged. Related: #167387, #167633, #168228.Evidence
0.164.0omitted both GPT-6.2 models;0.167.1,0.169.0, and99.0.0returned the same catalog with both listed. No live inference was attempted.git diff --checkpassed.ae6b903359e3found no actionable P0–P2 findings in the diff. It did not execute the project or independently verify unchanged surrounding source.