Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Custom Codex providers that require no OpenAI sign-in now report usage limits as unsupported instead of a probe error. The change is limited to status reporting and leaves authentication and provider execution unchanged. You can add or adjust custom eligibility rules. Learn more. |
Walkthrough
Merge Risk:
|
Problem
When Codex is configured with a custom
model_providerthat needs no sign-in (e.g. a local OpenAI-compatible proxy), the Usage → Limits page shows a warning such as<environment> · Codex: Codex could not read usage (JSON-RPC -32600).In that setup
account/readreturns{ account: null, requiresOpenaiAuth: false }. Codex has no account rate limits to report, soaccount/rateLimits/readis refused with-32600 "codex account authentication required to read rate limits". T3 Code treated that expected refusal as a failed probe (probeFailed) and surfaced it as an error.Change
checkCodexProviderStatusnow marks usage limits asunsupportedwhen there is no account and the app-server does not require OpenAI auth. This matches the existing handling for API-key accounts, which also have no account limits. Signed-out CLIs (requiresOpenaiAuth: true) are unchanged and still report thecodex loginmessage.Scope and approval
This is a very small, focused fix for an obvious bug: an expected protocol response for a supported configuration (custom model providers) is shown to users as an error. It extends the existing
apiKey→unsupportedbranch by one condition in one file and changes no product behavior beyond removing the false warning, so it qualifies without a prior issue or discussion.Verification
~/.codex/config.tomlsetsmodel_providerto a custom provider and there is noauth.json. Sending the probe's requests tocodex app-serverdirectly returned:account/read→{"account":null,"requiresOpenaiAuth":false,...}account/rateLimits/read→{"error":{"code":-32600,"message":"codex account authentication required to read rate limits"}}returns ready with unknown auth when app-server does not require OpenAI authtest inProviderRegistry.test.ts. It feeds that rate-limit failure and assertsusageLimits.unavailableis{ reason: "unsupported" }. It fails without the change (probeFailed) and passes with it.vp test run src/provider/ProviderRegistry.test.ts(39 passed) and the server typecheck pass.collectLimitNotices(packages/shared/src/usageLimits.ts), which skips providers whose usage isunsupported, so the warning no longer appears.Written with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code