OAuth model discovery omits required client_version and reports unknown access
Bug
codex-multi-auth check and codex-multi-auth check capabilities mark every OAuth workspace discovery failed and print:
OAUTH coverage incomplete; failed scopes have unknown access.
Login and live sessions still succeed. The catalog lookup is what fails.
Environment
Reproduced on one machine only:
- OS: Ubuntu 24.04.5 LTS (Noble Numbat), Linux 7.0.0-38-generic, x86_64
codex-cli0.160.1 (/home/linuxbrew/.linuxbrew/bin/codex)- app-server 0.162.1
codex-multi-auth2.19.1- rotation proxy disabled
Not reproduced on Windows or macOS. Do not treat this report as evidence that those platforms fail the same way.
Cause
On this Ubuntu host, GET https://chatgpt.com/backend-api/codex/models rejected a request that omitted client_version.
- Without it: HTTP 400,
Field requiredonquery.client_version. - With
client_version=0.162.1: HTTP 200 and a model list.
That pair of responses was captured from Ubuntu only. The official Codex client appends client_version in codex-rs/codex-api/src/endpoint/models.rs with no target_os guard, so the client contract is shared source, not a per-OS branch. That still is not a Windows or macOS run of this bug.
discoverModelInventory only adds that parameter when options.clientVersion is already set. refreshAndPrintModelInventory passes previous?.clientVersion from ~/.codex/multi-auth/model-discovery.json. A fresh inventory has no version. With the rotation proxy off, nothing else supplies one, so every scope on this host got the 400. AccountModelCatalog swallows the non-OK response, so the report says access is unknown instead of showing the 400.
Reproduced
codex-multi-auth check capabilities on the Ubuntu host above failed all six OAuth scopes. Writing clientVersion: "0.162.1" into model-discovery.json and running the same command returned 10 models per scope and dropped the warning.
main at the time of the report still had the same gate: client_version is forwarded only from a previous inventory or from an inbound proxy request.
Expected
Direct catalog discovery should send the installed codex --version (codex-cli 0.160.1 → 0.160.1 on this host) when the inventory has no stored version, then save that version for the next check. Do not hardcode a version; the catalog filters models by minimal_client_version.