Regression in v0.147.0 with LiteLLM provider — streaming requests consistently fail
What version of the Codex App are you using (From “About Codex” dialog)?
v0.147.0
What subscription do you have?
Custom litellm provider
What platform is your computer?
AlmaLinux 10.2 (Lavender Lion)
What issue are you seeing?
After upgrading Codex from v0.146.0 to v0.147.0, all requests made through our LiteLLM-backed custom provider fail with the error: "We're currently experiencing high demand, which may cause temporary errors." The internal logs repeatedly show stream disconnected - retrying sampling request in codex_core::responses_retry until the maximum number of retries is reached. Downgrading to v0.146.0 immediately resolves the issue with no configuration changes. The same LiteLLM endpoint, credentials, models, and configuration work correctly on v0.146.0, which suggests a regression in v0.147.0, potentially related to streaming or Responses API handling with LiteLLM-compatible providers.
What steps can reproduce the bug?
- Configure Codex to use a LiteLLM-backed custom provider.
- Run Codex with
v0.147.0. - Submit any prompt.
- The request fails after several retries with the
"high demand"error. - Downgrade Codex to
v0.146.0without changing the configuration. - Submit the same prompt again.
- The request succeeds normally.
What is the expected behavior?
Requests should complete successfully with v0.147.0, using the same LiteLLM endpoint and configuration that work correctly with v0.146.0.
Additional information
I don't have access to the LiteLLM configuration, as it is managed through our corporate gateway. However, I can confirm that both gpt-5.6-luna and gpt-5.6-terra work correctly with other coding assistants using the same infrastructure, and they also work correctly with Codex v0.146.0.
The issue only appears after upgrading to Codex v0.147.0. Downgrading back to v0.146.0 immediately resolves it, which strongly indicates that the regression was introduced in v0.147.0.
Regression: v0.146.0 ✅ / v0.147.0 ❌
5 Comments
The actual error comes from the service provider (Bedrock), not LiteLLM:
Invalid Value: 'tools.namespace'. User-defined namespace 'functions' collides with an existing tool namespace.Likely related to #36957
I compared
rust-v0.146.1..rust-v0.147.0and found a concrete request-shape regression that explains the Bedrock error.The introducing change is
f21dc46388/ #37022, “Canonicalize default tools under thefunctionsnamespace.”Before that change, Responses Lite placed ordinary function/custom tools in the
additional_toolsdeveloper item as flat entries:Since 0.147.0,
ModelClient::build_responses_requestcallscreate_tools_json_for_responses_lite()wheneveruse_responses_liteandprovider.capabilities().namespace_toolsare both true. That serializer moves all ordinary function/custom tools into an explicitly user-defined namespace:This also affects custom/LiteLLM providers because
ConfiguredModelProviderinheritsProviderCapabilities::default(), wherenamespace_tools: true. There is currently no provider capability negotiation or custom-provider config switch that distinguishes:functionsnamespace.Bedrock already owns/implicitly provides the
functionsnamespace, so the new explicit declaration is rejected with:That means the streaming retries and final “high demand” message are secondary/misleading symptoms; the underlying failure is a non-retryable provider-side request validation error.
The relevant 0.147.0 flow is:
codex-rs/core/src/client.rs: selectscreate_tools_json_for_responses_lite()whennamespace_toolsis true.codex-rs/tools/src/tool_spec.rs: constructsResponsesApiNamespace { name: "functions", ... }and moves flat function/custom tools into it.codex-rs/model-provider/src/provider.rs: defaultsnamespace_toolsto true, including forConfiguredModelProvider.I also checked current
main; the relevant serialization and custom-provider capability default are still present.A safe immediate workaround is to pin 0.146.1. A source-level workaround is to retain the pre-0.147 flat
create_tools_json_for_responses_api()representation for custom providers even inside the Responses Liteadditional_toolsitem. Settinguse_responses_lite: falsethrough a full model-catalog override may also bypass this exact path, but it changes more transport behavior and can expose separate reserved-namespace compatibility issues.For the durable fix, I suggest separating “supports namespace tools” from “supports an explicit default/functions namespace,” defaulting the latter to false for custom providers unless explicitly advertised. A regression test could use a configured custom provider with a Responses Lite model and assert that
additional_toolscontains flatfunction/customentries and no{"type":"namespace","name":"functions"}wrapper.Separately, this class of provider 4xx validation error should ideally not be retried and surfaced as “high demand,” since that obscures the actionable error.
A current workaround is:
Dump model catalog:
codex debug models --bundled > ~/.codex/models-bundled-0.147.jsonUnset the usage of responses-lite for gpt-5.6 models:
Reference it in your
~/.codex/config.tomlfile:model_catalog_json = "~/.codex/models-bundled-0.147-workaround.json"Hi @emerzon
Thanks a lot for your reply. Indeed, it seems that the issue stems from their new “namespace” functions. They appear to have assumed that all API providers work the same way as OpenAI
if I understand correctly, Codex sends a structure that Bedrock rejects. LiteLLM then converts or relays this error as an HTTP 500, and Codex ultimately hides the true cause behind its generic message
Thanks for your workaround, I hope they will fix the bug in next releases
I'm experiencing that this is inconsistent depending on what device I am on for reasons unclear. The Codex config is the same between the devices, the verisons are the same. One device is linux (generally seems to work) and the other is a mac; hitting either litellm or azure.