Repository navigation
fix(codex): refresh discovery client version automatically - #15663
Merged
diegosouzapw merged 2 commits intoOct 7, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
Contributor
|
Additional controlled reproduction supporting this change: keeping the same account and Responses request payload, changing only the advertised Codex client version produced:
The rejection with The live manifest reports This supports keeping discovery and inference on the same refreshed client identity, while preserving explicit overrides. Related catalog/model work: #15166. |
overbit
added a commit
to overbit/OmniRoute
that referenced
this pull request
Oct 7, 2026
Backport the reproduced discovery fix from upstream cheaper-inference#15663. Refresh the stable @openai/codex version from the official npm registry through the same guarded fetch path used for model discovery, then build the authenticated catalog URL and identity headers from that validated value. Synchronous inference consumers reuse the cache, while explicit operator overrides keep precedence. Retain the offline 0.159.2 pin and add focused refresh, cache, failure and remote-only discovery regression coverage.
…8.52 Keep the release Codex client pin. Discovery may cache a newer registry version, and a lower version cannot replace that pin. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
diegosouzapw
merged commit Oct 7, 2026
c6a2431
into
cheaper-inference:release/v3.8.52
3 checks passed
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.
Summary
Codex's model manifest gates newer models on the client version. OmniRoute uses a pinned discovery identity, so refreshing a connection can keep returning an obsolete catalog even after new models are available.
Refresh the stable
@openai/codexversion from the official npm registry before authenticated model discovery. Discovery URL and identity headers use the same validated version, and synchronous inference consumers reuse the cache. Explicit operator and caller identity overrides retain their precedence.The lookup is cached for six hours, coalesces concurrent requests, and retains the last-known-good version or existing pin when metadata is unavailable. Failed refreshes are throttled for five minutes. No CLI package is installed and inference adds no network lookup.
Related Issues
Validation
npm run lintnpm run typecheck:corenpm run check:provider-consistencynpm run check:provider-assetsrelease/v3.8.52base (112313aa); focused checks rerun afterwardFocused command (37 passing):
Independent review also passed 58 refresh/discovery/header tests. Security checks passed the refresh, outbound timeout and DNS suites (22 tests). Real read-only Codex discovery selected registry version
0.160.1and returnedgpt-6.1-sol,gpt-6-astra,gpt-6-sol, andgpt-6-luna; application imports were isolated with a temporaryDATA_DIRfor the final run.provider-translate-path-golden.test.tspasses 2/3 assertions on this macOS host. Its sole mismatch is six unchanged GitHub/GHEuser-agentfields: the committed snapshot expectslinux, while the runtime emitsdarwin. No Codex golden fields differ. The unrelated snapshot was not regenerated. Full suites, coverage and production build are deferred to CI as required by the golden path.Tests Added Or Updated
tests/unit/codex-client-version-refresh.test.ts(9 tests, demonstrated failing before implementation)Coverage Notes
The new tests cover successful metadata refresh, synchronized URL/headers, explicit overrides, cache expiry, single-flight, offline fallback/retry, malformed metadata and downgrade rejection, remote-only model IDs, missing credentials, body size limits and stalled-body cancellation. Existing discovery, identity and Claude tests cover adjacent behavior.
Reviewer Notes
The metadata request uses a fixed public HTTPS endpoint, DNS pinning, no redirects or account credentials, a 5-second deadline including body consumption, and a 64 KiB response cap. Package identity and bounded stable semver are validated with the existing Zod dependency.
Auto-Sync remains opt-in. Claude live discovery is already implemented in this release base and is unchanged. No static catalog, dependency, schema, or UI changes are included.