Skip to content

fix(oauth): send Codex client version header on upstream requests#1770

Open
axelray-dev wants to merge 1 commit into
agent0ai:mainfrom
axelray-dev:fix/codex-oauth-version-header
Open

fix(oauth): send Codex client version header on upstream requests#1770
axelray-dev wants to merge 1 commit into
agent0ai:mainfrom
axelray-dev:fix/codex-oauth-version-header

Conversation

@axelray-dev

Copy link
Copy Markdown

Summary

The Codex OAuth proxy listed GPT-5.6 family models via /models but completion calls failed with HTTP 404 Model not found. Upstream gates newer models on a client version request header. request_codex never sent that header, while the models catalog already passed client_version from resolve_codex_version().

Changes

  • Set the version request header in request_codex when resolve_codex_version() returns a non-empty value
  • Leave the header unset when no version is configured or discoverable
  • Extend the request header unit test for both non-empty and empty version cases

Fixes #1765

Verification

  • python3 -m pytest tests/test_oauth_codex.py -q -k "request_codex" -o addopts= (2 passed)

Backwards compatibility

No API or config changes. Clients without a resolvable Codex version behave as before (header omitted).

Upstream gates newer models on a version header. Attach
resolve_codex_version() when non-empty so completions match /models.

Fixes agent0ai#1765
@axelray-dev
axelray-dev marked this pull request as ready for review July 15, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codex_oauth wrapper omits version header → new models (GPT-5.6 family) return 404 despite appearing in /models

1 participant