Custom Responses provider intermittently fails with native `namespace` tool routing errors

Open 💬 16 comments Opened Jul 11, 2026 by soyuz43
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.144.1, 0.144.0, & 0.142.5

What subscription do you have?

plus

Which model were you using?

Openrouter Models

What platform is your computer?

Windows 11

What terminal emulator and version are you using (if applicable)?

Git bash

Codex doctor report

Tip: New Build faster with Codex.


› codex doctor --json


■ {"error":{"message":"No endpoints found that support the native `namespace` tool
type. To learn more about provider routing, visit:
https://openrouter.ai/docs/guides/routing/provider-selection","code":400}}

What issue are you seeing?

Custom Responses provider intermittently fails with native namespace tool routing errors

Summary

Codex CLI intermittently renders a previously working OpenRouter custom-provider profile unusable due to native/proprietary namespace tool routing errors.

OpenRouter rejects the request before model generation with:

{
  "error": {
    "message": "No endpoints found that support the native `namespace` tool type. To learn more about provider routing, visit: https://openrouter.ai/docs/guides/routing/provider-selection",
    "code": 400
  }
}

This happens even for ordinary prompts that do not request MCP tools, plugins, apps, connectors, collaboration, or subagents.

The same OpenRouter account, API key, Codex profile, repository, and model previously worked extensively. My OpenRouter dashboard records approximately:

  • 67.5 million tokens
  • 736 requests
  • Codex as the application
  • successful usage across multiple OpenRouter models

This was an established working development workflow, not an experimental configuration that never functioned.

Environment

  • OS: Windows 11
  • Shell: Git Bash / MINGW64
  • Provider: OpenRouter
  • Wire API: Responses
  • Model: tencent/hy3:free
  • Profile: ~/.codex/hy3_openrouter.config.toml
  • Codex versions reproduced:
  • 0.144.1
  • 0.144.0
  • 0.142.5
  • Authentication: OPENROUTER_API_KEY

Relevant redacted profile shape:

model_provider = "openrouter"
model = "tencent/hy3:free"
model_reasoning_effort = "high"
model_context_window = 262144
model_supports_reasoning_summaries = false

[model_providers.openrouter]
name = "OpenRouter"
base_url = "https://openrouter.ai/api/v1"
env_key = "OPENROUTER_API_KEY"
wire_api = "responses"

The profile is definitely being loaded. Codex displays:

OpenAI Codex (v0.142.5)
model: tencent/hy3:free high

Codex also prints:

Model metadata for `tencent/hy3:free` not found. Defaulting to fallback metadata;
this can degrade performance and cause issues.

That warning was also present during a session in which model generation and shell tool calls worked, so it is not itself the fatal error.

Reproduction

Launch Codex using the OpenRouter profile:

codex --profile hy3_openrouter

Send any prompt, including a plain text prompt or a normal repository task.

Codex immediately returns:

No endpoints found that support the native `namespace` tool type.

The model never processes the prompt.

Exact-version reproduction

To eliminate PATH ambiguity, I launched Codex 0.142.5 directly:

npx -y @openai/codex@0.142.5 --version
npx -y @openai/codex@0.142.5 --profile hy3_openrouter

The version command returned:

codex-cli 0.142.5

The TUI also confirmed:

OpenAI Codex (v0.142.5)

The same native namespace error occurred.

This means the failure is not limited to Codex 0.144.x.

Intermittent successful session

During one Codex 0.142.5 session using the same profile, the request successfully reached the model.

The model generated and attempted multiple shell calls, including:

git status
git branch --show-current
git log --oneline -5
echo hello

Some Git commands were separately rejected by the Windows sandbox policy, but:

echo hello

executed successfully and returned output.

That proves the following worked during that session:

  • Codex contacted OpenRouter.
  • OpenRouter routed the request to a model endpoint.
  • The model generated a response.
  • Codex received tool calls.
  • Codex entered its normal tool-execution loop.

After exiting and launching a fresh session with the same Codex 0.142.5 binary and the same profile, the first prompt again failed before generation with the native namespace routing error.

The result therefore varies across launches despite the same binary and profile. Possible explanations include differences in the effective outbound tool set, persisted or dynamically registered capabilities, or OpenRouter’s upstream endpoint selection. I have not isolated which variable accounts for the intermittency.

Attempted feature reduction

I also launched Codex while disabling the obvious features that could introduce namespace tools, including multi-agent, collaboration, apps/connectors, plugins, MCP-related app support, tool search, and MCP elicitation.

Codex emitted deprecation warnings such as:

[features].collab is deprecated. Use [features].multi_agent instead.

[features].connectors is deprecated. Use [features].apps instead.

The replacement feature names were also disabled.

The request still failed with the exact same error:

No endpoints found that support the native `namespace` tool type.

This suggests that the condition triggering the namespace routing error may involve:

  • another built-in Codex tool path;
  • tool registration independent of the expected feature flags;
  • persistent plugin, MCP, app, or session state;
  • or a tool that remains serialized after its associated feature has been disabled.

Actual behavior

The request appears to contain, or is being interpreted as containing, a native namespace tool.

OpenRouter rejects the request during endpoint selection before an underlying inference provider processes the prompt.

The error does not identify:

  • the rejected namespace name;
  • which Codex feature registered it;
  • whether it came from MCP, a plugin, an app, collaboration, or another built-in tool;
  • the effective outbound tool list;
  • or a supported configuration option that disables or flattens namespace tools.

Because every OpenRouter model profile passes through the same Responses routing layer, multiple unrelated models fail with the same error.

Expected behavior

For custom providers configured with:

wire_api = "responses"

Codex should not assume support for proprietary native namespace tools.

Codex should do one or more of the following:

  1. Default custom Responses providers to standard function tools.
  1. Flatten namespace tools into uniquely named top-level function tools.
  1. Omit optional namespace tools unless the provider explicitly advertises support.
  1. Provide a documented provider capability setting such as:

``toml
namespace_tools = false
``

  1. Ensure that disabling a feature removes its corresponding namespace from the serialized request.
  1. Produce a deterministic outbound tool set for identical versions, profiles, and sessions.
  1. Report the exact namespace and originating feature when a provider rejects it.
  1. Expose the final serialized tool list through debug logging or codex doctor.

More generally, protocol selection and capability negotiation should be independent. Configuring a provider to use the Responses API should not, by itself, imply support for proprietary namespace tool types.

Impact

This failure blocks all Codex work through the affected OpenRouter profiles, including simple prompts that do not use advanced tooling.

Changing the prompt does not help because the request is rejected before generation.

Switching among OpenRouter models does not help because the common request envelope is rejected before an underlying endpoint is selected.

The failure caused the sudden loss of an established workflow that had already processed tens of millions of tokens successfully.

Users should not need to:

  • downgrade several Codex releases;
  • repeatedly recreate sessions;
  • guess at undocumented feature combinations;
  • disable unrelated functionality;
  • inspect internal HTTP payloads;
  • or build a localhost request-rewriting proxy

to make Codex send a compatible Responses request.

Requested investigation

Please determine:

  1. Whether the serialized request contains a native namespace tool and, if so, which tool and feature introduced it.
  2. Why the same 0.142.5 binary and profile can succeed in one session and fail after relaunch.
  3. Whether fallback model metadata affects provider capability or tool selection.
  4. Whether disabled features are actually removed from the serialized request.
  5. Whether plugins, apps, MCP servers, cached model metadata, or session state dynamically alter the tool schema.
  6. Why custom Responses-provider requests trigger native namespace-tool routing without explicit capability opt-in.
  7. Whether Codex can flatten namespace tools automatically for generic Responses providers.
  8. Whether Codex can expose the effective outbound request tool list in diagnostic output.
  9. Whether Codex currently conflates protocol selection (wire_api = "responses") with capability assumptions (such as native namespace tool support) for third-party Responses providers.
I am happy to refine the approach based on maintainer feedback.

Related issues

This appears related to:

  • #23186 — Codex wraps MCP tools in type: "namespace" for custom/local providers.
  • #26234 — proposal to flatten namespace tools for OpenRouter, Ollama, and LM Studio.
  • #31875 — custom/Azure Responses failure caused by Codex-specific collaboration namespace tooling.

This report adds two important observations:

  1. The same Codex 0.142.5 binary and profile can alternate between successful model tool execution and complete pre-generation rejection.
  2. Disabling the obvious namespace-producing feature groups does not prevent OpenRouter from receiving or detecting a native namespace tool.

What steps can reproduce the bug?

  1. Configure an OpenRouter model provider with wire_api = "responses".
  2. Launch Codex using a profile that selects that provider.
  3. Submit any prompt.
  4. Observe that OpenRouter rejects the request before model generation with the native namespace tool routing error.

What is the expected behavior?

Custom providers using the Responses API should be able to process ordinary prompts without Codex requiring support for proprietary native namespace tools. Unsupported optional tools should be omitted or flattened into standard function tools unless the provider explicitly advertises native namespace support.

Additional information

_No response_

View original on GitHub ↗

16 Comments

github-actions[bot] contributor · 10 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #31875
  • #32155

Powered by Codex Action

soyuz43 · 10 days ago

Just fyi, its all profiles for openrouter that produce this failure, not only hy3, but deepseekv4 flash, Ring, North mini-code, etc.

ndurner · 8 days ago
Just fyi, its all profiles for openrouter that produce this failure, not only hy3, but deepseekv4 flash, Ring, North mini-code, etc.

OpenAI models seem to work, though. Tested with GPT-5.6 Terra.

bharat2808 · 8 days ago

I ran into this same class of problem while using Codex with Ollama and a custom Responses API provider.

I built an experimental user-space workaround called [codex-ollama-proxy](https://github.com/bharat2808/codex-ollama-proxy):

npm install -g codex-ollama-proxy
codex-ollama-proxy init
codex-ollama-proxy install

I am the package author.

The proxy runs locally between Codex and the configured Responses API upstream. It currently handles the relevant Codex-specific tool shapes by:

  • flattening type: "namespace" tools into standard function tools;
  • mapping returned flat function names back to Codex’s { namespace, name } format;
  • lifting newer additional_tools input items into the top-level tool list;
  • translating custom tools such as apply_patch;
  • translating ordinary tool_search function calls back into native tool_search_call items.

This allowed me to keep Codex app plugins and tools available while using Ollama in my setup.

It is unofficial and experimental, and an upstream Codex fix would still be preferable. Codex’s internal request shapes can change between releases, so I would appreciate test reports that include the Codex version, operating system, model, provider and failing tool name.

GitHub: https://github.com/bharat2808/codex-ollama-proxy
npm: https://www.npmjs.com/package/codex-ollama-proxy

soyuz43 · 8 days ago

For anyone affected by this issue, an unofficial fork now has a merged implementation that flattens Codex namespace tools for third-party Responses API providers:

I did not create or independently audit this fork, but I tested the compiled Windows executable against the OpenRouter configuration from this issue. It allowed me to start fresh Codex CLI sessions using my affected OpenRouter profiles without receiving the native namespace tool-routing error.

My provider configuration uses:

[model_providers.openrouter]
namespace_tools = false

I kept the forked executable separate from the official installation and launched it with an alias like:

alias hy3='codex-minustenshi --profile hy3_openrouter'

One setup issue I encountered: the official build and fork initially shared the same Codex SQLite state under ~/.codex. Because the fork’s database migrations differed, I deleted my existing state_*.sqlite, state_*.sqlite-wal, and state_*.sqlite-shm files before starting fresh.

Deleting those files removes locally stored Codex conversation/history state, so nobody should do that without understanding the consequence or preserving a backup. Using a separate CODEX_HOME would likely be a cleaner way to isolate the fork.

This is only an unofficial workaround and does not replace an upstream fix, but it may also provide a useful implementation reference for maintainers.

soyuz43 · 8 days ago

One follow-up observation after testing the unofficial fork that implements namespace_tools = false / namespace flattening:

Since switching to that build, I haven't been able to reproduce the routing error on the same OpenRouter profiles.

Looking back, this also makes me wonder whether the intermittent behavior I observed could have been explained by endpoint selection—for example, some upstream providers accepting the namespace tool shape while others rejected it. I don't have evidence that this is what was happening, so consider this a hypothesis rather than a conclusion, but it would explain why identical profiles sometimes succeeded and sometimes failed before generation.

soyuz43 · 8 days ago
Potential duplicates detected. Please review them and close your issue if it is a duplicate. Codex CLI with Azure OpenAI gpt-5.6-sol fails due to Codex-specific tools / collaboration namespace #31875 Codex app (new ChatGpt app) broken after big update #32155 _Powered by Codex Action_

I believe this is not a duplicate because of both the intermittent nature and OpenRouter-specific observations are not covered by the other tickets

Kuasa5Indra · 7 days ago

Hello there, I encountered the same thing on intel mac. So does the problem is on codex cli or openrouter provider or both ?

soyuz43 · 7 days ago
Hello there, I encountered the same thing on intel mac. So does the problem is on codex cli or openrouter provider or both ?

From what I've seen, I think it's an interoperability issue rather than exclusively a Codex or OpenRouter bug.

The unofficial fork that flattens namespace tools into standard function tools completely eliminated the problem for me on the same OpenRouter profiles, which strongly suggests the request format is the trigger.

I also observed some intermittent behavior, so I have a hypothesis (not evidence) that different upstream providers may differ in their support for native namespace tools, but I can't confirm that from the outside.

Kuasa5Indra · 6 days ago
> Hello there, I encountered the same thing on intel mac. So does the problem is on codex cli or openrouter provider or both ? From what I've seen, I think it's an interoperability issue rather than exclusively a Codex or OpenRouter bug. The unofficial fork that flattens namespace tools into standard function tools completely eliminated the problem for me on the same OpenRouter profiles, which strongly suggests the request format is the trigger. I also observed some intermittent behavior, so I have a hypothesis (not evidence) that different upstream providers may differ in their support for native namespace tools, but I can't confirm that from the outside.

I also encountered it on kilo code models. Some models somehow routes into openrouter thingy except stepfun/step-3.7-flash:free

/status

╭──────────────────────────────────────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.144.3) │
│ │
│ Model: poolside/laguna-m.1:free (reasoning high, summaries auto) │
│ Model provider: kilo - https://api.kilo.ai/api/gateway
│ Directory: ~/secret-project │
│ Permissions: Workspace (Ask for approval) │
│ Agents.md: /Users/indra/.codex/AGENTS.md │
│ Collaboration mode: Default │
│ Session: 019f5f4e-ed9f-70d3-b218-db900fe2ea92 │
│ │
│ Token usage: 0 total (0 input + 0 output) │
│ Limits: data not available yet │
╰──────────────────────────────────────────────────────────────────────────────────╯

› hello ?

■ {"error":{"message":"No endpoints found that support the native namespace tool type. To learn more about provider routing, visit:
https://openrouter.ai/docs/guides/routing/provider-selection","code":400}}

› Explain this codebase

poolside/laguna-m.1:free high · ~/secret-project

Kuasa5Indra · 6 days ago
> Hello there, I encountered the same thing on intel mac. So does the problem is on codex cli or openrouter provider or both ? From what I've seen, I think it's an interoperability issue rather than exclusively a Codex or OpenRouter bug. The unofficial fork that flattens namespace tools into standard function tools completely eliminated the problem for me on the same OpenRouter profiles, which strongly suggests the request format is the trigger. I also observed some intermittent behavior, so I have a hypothesis (not evidence) that different upstream providers may differ in their support for native namespace tools, but I can't confirm that from the outside.

Allright so what are temporary solution we can do first so we can still use it for long period ?

soyuz43 · 6 days ago
> > Hello there, I encountered the same thing on intel mac. So does the problem is on codex cli or openrouter provider or both ? > > > From what I've seen, I think it's an interoperability issue rather than exclusively a Codex or OpenRouter bug. > The unofficial fork that flattens namespace tools into standard function tools completely eliminated the problem for me on the same OpenRouter profiles, which strongly suggests the request format is the trigger. > I also observed some intermittent behavior, so I have a hypothesis (not evidence) that different upstream providers may differ in their support for native namespace tools, but I can't confirm that from the outside. Allright so what are temporary solution we can do first so we can still use it for long period ?

There are solutions linked above. The temporary workarounds currently are:

  1. Use the unofficial MinusTenshiC fork, configure the third-party provider with:

[model_providers.<provider-name>]
namespace_tools = false

Keep it isolated from the official Codex installation, preferably with a separate
CODEX_HOME. The fork may use different SQLite migrations, so do not share or
delete state files without backing them up and understanding that local history
may be lost.

  1. Use the experimental codex-ollama-proxy linked above, which rewrites Codex-specific

namespace/custom tool shapes into forms accepted by compatible third-party
Responses providers.

  1. Use a model/provider route that happens to accept the emitted tool schema, although

this is not a reliable general solution.

These are unofficial workarounds. The durable fix still needs to happen upstream in
Codex through provider capability handling or namespace-tool flattening.

soyuz43 · 6 days ago
> > > Hello there, I encountered the same thing on intel mac. So does the problem is on codex cli or openrouter provider or both ? > > > > > > From what I've seen, I think it's an interoperability issue rather than exclusively a Codex or OpenRouter bug. > > The unofficial fork that flattens namespace tools into standard function tools completely eliminated the problem for me on the same OpenRouter profiles, which strongly suggests the request format is the trigger. > > I also observed some intermittent behavior, so I have a hypothesis (not evidence) that different upstream providers may differ in their support for native namespace tools, but I can't confirm that from the outside. > > > Allright so what are temporary solution we can do first so we can still use it for long period ? There are solutions linked above. The temporary workarounds currently are: 1. Use the unofficial MinusTenshiC fork, configure the third-party provider with: [model_providers.] namespace_tools = false Keep it isolated from the official Codex installation, preferably with a separate CODEX_HOME. The fork may use different SQLite migrations, so do not share or delete state files without backing them up and understanding that local history may be lost. 2. Use the experimental codex-ollama-proxy linked above, which rewrites Codex-specific namespace/custom tool shapes into forms accepted by compatible third-party Responses providers. 3. Use a model/provider route that happens to accept the emitted tool schema, although this is not a reliable general solution. These are unofficial workarounds. The durable fix still needs to happen upstream in Codex through provider capability handling or namespace-tool flattening.

Update: the unofficial MinusTenshiC fork and Windows release I linked earlier are no longer available; those URLs now return 404/Page Not Found.

So that workaround should be considered unavailable unless the repository or release is restored elsewhere.

The remaining temporary workaround currently documented in this thread is the experimental codex-ollama-proxy. Otherwise, the durable fix still needs to happen upstream in Codex through provider capability handling or namespace-tool flattening.

Kuasa5Indra · 6 days ago

Ok what about codex desktop app @soyuz43 . Will it also affected by that ?

Lin-Jiong-HDU · 5 days ago

Same root cause here, on a deepseek-v4-pro endpoint via a third-party OpenAI-compatible Responses provider. Adding a source-level root-cause, since the thread so far is black-box observation.

Symptom variant

Unlike OpenRouter which returns the explicit No endpoints found that support the native namespace tool type error, my endpoint silently ignores the namespace tool and returns HTTP 200. There's no error — the model just never sees the namespace/MCP tools (it lists only built-ins: exec_command, write_stdin, list_mcp_resources, …). RUST_LOG=trace confirms codex _does_ fetch the MCP server's tools (listed MCP server tools ... tool_count=33); they just never reach the model. So endpoints that silently drop the namespace type instead of rejecting it are affected too, just harder to notice.

Root cause (codex-rs main)

  • core/src/tools/handlers/mcp.rs create_tool_spec (~line 233) wraps every MCP tool in ToolSpec::Namespace(ResponsesApiNamespace{...}), serialized as {"type":"namespace",...} (an OpenAI Responses API tool type; tools/src/responses_api.rs).
  • merge_into_namespaces (core/src/tools/spec_plan.rs:517) coalesces same-namespace tools into one container. This is also why disabling individual features (multi-agent/apps/plugins/MCP/tool_search) doesn't help — namespace is the unified container for all tool groups, built-ins included (current_time/sleep share one, multi-agent uses one, etc.).
  • The namespace_tools provider capability (model-provider/src/provider.rs) is the intended escape hatch, but its current false implementation filters namespace tools out of the model-visible list entirely (spec_plan.rs: namespace_tools_enabled || !Namespace) rather than expanding them into plain functions — so the model still can't use them. Every provider currently defaults to true, so the false branch is never exercised in practice.
soyuz43 · 5 days ago
Ok what about codex desktop app @soyuz43 . Will it also affected by that ?

I don’t know, I don’t use the desktop app. My best guess is that it could be affected if it uses the same request path and tool schema, but I haven’t tested it.

If it is affected, and my understanding is accurate, this experimental npm package may help by rewriting Codex-specific namespace and tool shapes for compatible third-party Responses providers. I did not author, audit, or test it:

GitHub: https://github.com/bharat2808/codex-ollama-proxy npm: https://www.npmjs.com/package/codex-ollama-proxy