Custom provider HTTP 500 errors are mislabeled as OpenAI high demand
What version of Codex CLI is running?
codex-cli 0.144.3
Platform
macOS arm64
What issue are you seeing?
When a custom OpenAI-compatible Responses provider returns HTTP 500, Codex discards the provider error details and displays:
We are currently experiencing high demand, which may cause temporary errors.
That message attributes an arbitrary custom-provider failure to service demand. A custom provider can use HTTP 500 for many unrelated conditions, so the message is misleading and hides the diagnostic information needed to fix the provider or request.
Minimal reproduction
- Configure a custom provider with
wire_api = "responses"and an HTTP base URL. - Have the fixture endpoint return:
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{"error":{"code":"fixture_failure","message":"fixture-specific failure"}}
- Send any Codex prompt through that provider.
- Observe that Codex reports generic high demand rather than the HTTP status or fixture error.
Expected behavior
For custom providers, Codex should preserve a bounded provider error message, for example:
Custom provider returned HTTP 500: fixture-specific failure
The OpenAI-specific high-demand wording should be reserved for an explicit overload/capacity error code, not every HTTP 500.
Source-level cause
In codex-rs/codex-api/src/api_bridge.rs, TransportError::Http maps every StatusCode::INTERNAL_SERVER_ERROR directly to CodexErr::InternalServerError. In codex-rs/protocol/src/error.rs, that variant has the fixed high-demand display text. The HTTP body is therefore discarded for this status.
A safer mapping would retain the bounded response body for custom providers, or use the generic UnexpectedStatus representation unless an explicit overload code is present.
Additional information
This is the general form of the behavior previously reported for another custom backend in #2445, but it remains reproducible in CLI 0.144.3. This report intentionally uses only a synthetic fixture and contains no private provider details.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗