Repository navigation
Let Codex use newly available account models before catalog refresh - #127394
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
pash-openai
enabled auto-merge (squash)
August 21, 2026 19:00
pash-openai
force-pushed
the
pash/codex-native-future-models
branch
from
August 21, 2026 19:08
30dba81 to
62098d3
Compare
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 22, 2026
…penclaw#127394) * Let Codex run newly available account models without host credentials * Keep authored provider routes ahead of native account authentication * Keep native Codex account discovery consistent with model availability * Preserve advanced reasoning for newly discovered Codex models
obviyus
added a commit
that referenced
this pull request
Oct 1, 2026
…PI-key users (#162563) ## What Problem This Solves Fixes: with an OpenAI API key, chat models that the account's `/v1/models` lists but the bundled manifest doesn't (for example `gpt-5.2`, `gpt-4.1`, `o3`) are missing from `/models`. Selecting one fails with `Unknown model: openai/gpt-5.2`. ## User Impact API-key users can pick and run current GPT and o-series chat models that their account exposes, including future ids that ship before a manifest update. Manifest models keep their existing rows and prices. Admitted models report cost as unknown: the cost is omitted, not shown as `$0`. Media, realtime, search, embedding, legacy, dated-snapshot, fine-tune and experiment ids stay hidden. ## Why This Change Was Made #114258 intersects the manifest with the account's live catalog so OpenClaw advertises only models the account can use, and manifest metadata wins. This change keeps that intersection. It also admits live ids that match current chat families (`gpt-4o`, `gpt-4.1`, `gpt-5`+, `o1`+) and are neither known route ids nor manifest rows. Admitted rows are deliberately conservative: Responses API, text-only input, 128k context, 16,384 max output tokens, and reasoning only for GPT-5+ and o-series. Their cost uses the existing zero placeholder. Shared usage reporting already treats zero catalog rates as unknown pricing, so it omits the cost instead of reporting `$0`. Some families appear in `/v1/models` but return 404 on `/v1/responses` for the same key: every `*-chat-latest` and `*-cyber` id, and all `*-codex` ids except `gpt-5.3-codex`. They are excluded, along with `preview`, `alpha` and `beta` variants. The admission rules now live in a new `account-models.ts`, and the API-key catalog tests moved to `openai-api-key-catalog.test.ts`. The provider module and its test file stay within their line-count caps. ## Evidence - Regression test `admits account chat models missing from the manifest with conservative metadata` fails on `main` (`expected [ 'gpt-5.5' ]`) and passes on this branch. It covers admitted rows (`gpt-4.1-mini`, a future `gpt-6.2`, `o3`), conservative metadata, the zero cost placeholder, manifest precedence, and 25 excluded ids (snapshot, chat-latest, codex, cyber, preview/alpha/beta, search, audio, realtime, image, embedding, moderation, fine-tune, experiment). - Live before/after with the same real API key against two isolated Gateways built from `main` (`d0f06ee`) and this branch: - The account's `/v1/models` lists 169 ids. `models.list` showed 16 OpenAI rows on `main` and 34 on the branch. The 18 added ids are `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4o`, `gpt-4o-mini`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-5-pro`, `gpt-5.1`, `gpt-5.2`, `gpt-5.2-pro`, `o1`, `o1-pro`, `o3`, `o3-mini`, `o3-pro` and `o4-mini`. Each one returned 200 from a direct `/v1/responses` probe. The picker gained no non-chat ids. All 16 manifest rows, including `gpt-6.1-sol` from #161400, are identical on both builds. - Running a turn on `openai/gpt-5.2`: `main` fails with `Unknown model: openai/gpt-5.2`. The branch replies `ok`. The run reports usage (20k input / 5 output tokens) with no `costUsd`, and `/status` shows tokens but no Cost row. - `openai/gpt-6.1-sol` (manifest-owned) works the same on both builds, with priced cost (`$0.0028` on `main`, `$0.0025` on the branch). - `pnpm test extensions/openai/openai-provider.test.ts extensions/openai/openai-api-key-catalog.test.ts`: 70 passed. `pnpm check:changed` passed. - Test cost: the only new test is the regression; the other nine API-key catalog tests moved unchanged out of `openai-provider.test.ts`. Local `pnpm test <file> --maxWorkers=1` wall time is 25.0s for `openai-api-key-catalog.test.ts` (10 tests) and 23.8s for `openai-provider.test.ts` (60 tests), mostly transform. In CI run [36839484116](https://github.com/openclaw/openclaw/actions/runs/36839484116), test time sums to 2.07s and 12.8s; the new regression takes 3ms. - No overlap with Pash/Sarah changes: #127394 touches only the ChatGPT/Codex discovery path and shared test fixtures. Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 2, 2026
…PI-key users (openclaw#162563) ## What Problem This Solves Fixes: with an OpenAI API key, chat models that the account's `/v1/models` lists but the bundled manifest doesn't (for example `gpt-5.2`, `gpt-4.1`, `o3`) are missing from `/models`. Selecting one fails with `Unknown model: openai/gpt-5.2`. ## User Impact API-key users can pick and run current GPT and o-series chat models that their account exposes, including future ids that ship before a manifest update. Manifest models keep their existing rows and prices. Admitted models report cost as unknown: the cost is omitted, not shown as `$0`. Media, realtime, search, embedding, legacy, dated-snapshot, fine-tune and experiment ids stay hidden. ## Why This Change Was Made openclaw#114258 intersects the manifest with the account's live catalog so OpenClaw advertises only models the account can use, and manifest metadata wins. This change keeps that intersection. It also admits live ids that match current chat families (`gpt-4o`, `gpt-4.1`, `gpt-5`+, `o1`+) and are neither known route ids nor manifest rows. Admitted rows are deliberately conservative: Responses API, text-only input, 128k context, 16,384 max output tokens, and reasoning only for GPT-5+ and o-series. Their cost uses the existing zero placeholder. Shared usage reporting already treats zero catalog rates as unknown pricing, so it omits the cost instead of reporting `$0`. Some families appear in `/v1/models` but return 404 on `/v1/responses` for the same key: every `*-chat-latest` and `*-cyber` id, and all `*-codex` ids except `gpt-5.3-codex`. They are excluded, along with `preview`, `alpha` and `beta` variants. The admission rules now live in a new `account-models.ts`, and the API-key catalog tests moved to `openai-api-key-catalog.test.ts`. The provider module and its test file stay within their line-count caps. ## Evidence - Regression test `admits account chat models missing from the manifest with conservative metadata` fails on `main` (`expected [ 'gpt-5.5' ]`) and passes on this branch. It covers admitted rows (`gpt-4.1-mini`, a future `gpt-6.2`, `o3`), conservative metadata, the zero cost placeholder, manifest precedence, and 25 excluded ids (snapshot, chat-latest, codex, cyber, preview/alpha/beta, search, audio, realtime, image, embedding, moderation, fine-tune, experiment). - Live before/after with the same real API key against two isolated Gateways built from `main` (`dd8d9f0`) and this branch: - The account's `/v1/models` lists 169 ids. `models.list` showed 16 OpenAI rows on `main` and 34 on the branch. The 18 added ids are `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4o`, `gpt-4o-mini`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-5-pro`, `gpt-5.1`, `gpt-5.2`, `gpt-5.2-pro`, `o1`, `o1-pro`, `o3`, `o3-mini`, `o3-pro` and `o4-mini`. Each one returned 200 from a direct `/v1/responses` probe. The picker gained no non-chat ids. All 16 manifest rows, including `gpt-6.1-sol` from openclaw#161400, are identical on both builds. - Running a turn on `openai/gpt-5.2`: `main` fails with `Unknown model: openai/gpt-5.2`. The branch replies `ok`. The run reports usage (20k input / 5 output tokens) with no `costUsd`, and `/status` shows tokens but no Cost row. - `openai/gpt-6.1-sol` (manifest-owned) works the same on both builds, with priced cost (`$0.0028` on `main`, `$0.0025` on the branch). - `pnpm test extensions/openai/openai-provider.test.ts extensions/openai/openai-api-key-catalog.test.ts`: 70 passed. `pnpm check:changed` passed. - Test cost: the only new test is the regression; the other nine API-key catalog tests moved unchanged out of `openai-provider.test.ts`. Local `pnpm test <file> --maxWorkers=1` wall time is 25.0s for `openai-api-key-catalog.test.ts` (10 tests) and 23.8s for `openai-provider.test.ts` (60 tests), mostly transform. In CI run [36839484116](https://github.com/openclaw/openclaw/actions/runs/36839484116), test time sums to 2.07s and 12.8s; the new regression takes 3ms. - No overlap with Pash/Sarah changes: openclaw#127394 touches only the ChatGPT/Codex discovery path and shared test fixtures. Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus
added a commit
that referenced
this pull request
Oct 8, 2026
…elease (#167387) Related: #157920 ## What Problem This Solves Fixes: new ChatGPT-login models stay hidden from `/models` until an OpenClaw release, because model discovery reports a hard-coded Codex client version. ## User Impact User impact: with ChatGPT login, models that need a newer Codex client appear in the model list once that Codex version is published to npm, with no OpenClaw release. Example: 2026.9.8 reports `client_version=0.158.0`, so the ChatGPT backend hides `gpt-6.1-sol`. With this change, OpenClaw reports `0.161.0` (current npm `latest`) and the model appears. ## Why This Change Was Made ChatGPT model discovery now asks npm for `@openai/codex`'s `latest` stable version and sends it as `client_version`. - One small request to `registry.npmjs.org`, through the SSRF guard, with a 5 s timeout. - The version is cached for 6 hours. Concurrent discoveries share one request. - If npm is unreachable or returns something odd, OpenClaw keeps the last version it got from npm, or the bundled pin (`0.160.0`, unchanged contract test) if it never got one, and retries after 5 minutes. - If the model-list request itself fails, the previous list stays (existing catalog retention for failed providers). - Only stable versions are used. If OpenClaw pins a newer prerelease, the pin wins. - This changes only the version OpenClaw *reports* for discovery. The bundled Codex binary and the Codex harness are unchanged. Tradeoff: #113615 aligned this value with the bundled Codex pin. Reporting a newer version can list a model whose protocol the current build does not handle yet; that model then fails on its first turn instead of being hidden. We chose visible-and-explainable over silently missing. This is the same tradeoff Hermes makes (it reports `99.0.0`); a real published version is more honest and avoids out-of-sequence version handling on the backend. ## Evidence **Backend behavior (real ChatGPT account, token kept in the browser):** visible models by `client_version`: | `client_version` | `gpt-6.1-sol` listed | |---|---| | `0.158.0` (2026.9.8 pin) | no | | `0.160.0` (current pin) | yes | | `0.161.0` (npm `latest`) | yes | **Real CLI flow** (`pnpm openclaw --profile <isolated> models list --provider openai --refresh --plain`, ChatGPT OAuth profile). To make the run discriminating, the fallback pin was temporarily set to `0.158.0` in a throwaway edit (reverted): - npm reachable → `openai/gpt-6.1-sol` listed (npm `latest` 0.161.0 wins over the old pin). - npm lookup forced to fail → `openai/gpt-6.1-sol` missing (falls back to the old pin). **Real npm lookup through the guarded fetch:** first call returned `.../models?client_version=0.161.0` in 356 ms; the second call hit the cache in 0 ms. **Tests:** new unit tests cover the npm version, cache reuse and expiry, shared in-flight request, fallback on HTTP error / prerelease / older-than-pin, keeping the last npm version when a later refresh fails, and the 5-minute failure retry. Existing OpenAI discovery tests pass with the resolver isolated. `node scripts/check-changed.mjs` passes. No overlap with Pash/Sarah changes: `4573635c77f` (#127394) touches `openai-provider.test.ts` for account-model routing, not discovery versioning. **Merge danger:** two-way door. No stored state, config, or schema change; a revert restores the pinned version. Blast radius: ChatGPT-login model discovery only. Worst case, a model that the current build cannot drive appears in the list and fails on its first turn. Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 9, 2026
…elease (openclaw#167387) Related: openclaw#157920 ## What Problem This Solves Fixes: new ChatGPT-login models stay hidden from `/models` until an OpenClaw release, because model discovery reports a hard-coded Codex client version. ## User Impact User impact: with ChatGPT login, models that need a newer Codex client appear in the model list once that Codex version is published to npm, with no OpenClaw release. Example: 2026.9.8 reports `client_version=0.158.0`, so the ChatGPT backend hides `gpt-6.1-sol`. With this change, OpenClaw reports `0.161.0` (current npm `latest`) and the model appears. ## Why This Change Was Made ChatGPT model discovery now asks npm for `@openai/codex`'s `latest` stable version and sends it as `client_version`. - One small request to `registry.npmjs.org`, through the SSRF guard, with a 5 s timeout. - The version is cached for 6 hours. Concurrent discoveries share one request. - If npm is unreachable or returns something odd, OpenClaw keeps the last version it got from npm, or the bundled pin (`0.160.0`, unchanged contract test) if it never got one, and retries after 5 minutes. - If the model-list request itself fails, the previous list stays (existing catalog retention for failed providers). - Only stable versions are used. If OpenClaw pins a newer prerelease, the pin wins. - This changes only the version OpenClaw *reports* for discovery. The bundled Codex binary and the Codex harness are unchanged. Tradeoff: openclaw#113615 aligned this value with the bundled Codex pin. Reporting a newer version can list a model whose protocol the current build does not handle yet; that model then fails on its first turn instead of being hidden. We chose visible-and-explainable over silently missing. This is the same tradeoff Hermes makes (it reports `99.0.0`); a real published version is more honest and avoids out-of-sequence version handling on the backend. ## Evidence **Backend behavior (real ChatGPT account, token kept in the browser):** visible models by `client_version`: | `client_version` | `gpt-6.1-sol` listed | |---|---| | `0.158.0` (2026.9.8 pin) | no | | `0.160.0` (current pin) | yes | | `0.161.0` (npm `latest`) | yes | **Real CLI flow** (`pnpm openclaw --profile <isolated> models list --provider openai --refresh --plain`, ChatGPT OAuth profile). To make the run discriminating, the fallback pin was temporarily set to `0.158.0` in a throwaway edit (reverted): - npm reachable → `openai/gpt-6.1-sol` listed (npm `latest` 0.161.0 wins over the old pin). - npm lookup forced to fail → `openai/gpt-6.1-sol` missing (falls back to the old pin). **Real npm lookup through the guarded fetch:** first call returned `.../models?client_version=0.161.0` in 356 ms; the second call hit the cache in 0 ms. **Tests:** new unit tests cover the npm version, cache reuse and expiry, shared in-flight request, fallback on HTTP error / prerelease / older-than-pin, keeping the last npm version when a later refresh fails, and the 5-minute failure retry. Existing OpenAI discovery tests pass with the resolver isolated. `node scripts/check-changed.mjs` passes. No overlap with Pash/Sarah changes: `a9c35f3d0f6` (openclaw#127394) touches `openai-provider.test.ts` for account-model routing, not discovery versioning. **Merge danger:** two-way door. No stored state, config, or schema change; a revert restores the pinned version. Blast radius: ChatGPT-login model discovery only. Worst case, a model that the current build cannot drive appears in the list and fails on its first turn. Co-authored-by: Ayaan Zaidi <[email protected]>
This was referenced Oct 9, 2026
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.
Codex can expose a new model through its own account before OpenClaw has refreshed its provider catalog. Today that request can fail three times: the early harness probe runs before auth is prepared, the provider rejects an unfamiliar model, and a single native route incorrectly demands a host credential. This change lets an explicitly selected Codex runtime own model discovery and authentication in that narrow case while preserving authored endpoints, explicit credentials, incompatible routes, and configured reasoning options.