bug: spawn_agent returns "unsupported call" for custom providers (flat dotted tool names)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
With certain (non-OpenAI / custom) model providers, namespaced tool calls arrive on the wire flattened into a single dotted name with namespace: None, e.g. multi_agent_v1.spawn_agent.
The router builds the lookup key from that name under the default namespace, so the registered (namespace, name) handler is missed and the model receives unsupported call: multi_agent_v1.spawn_agent.
Repro
# config.toml
"experimental_supported_tools": [
"multi_agent_v1",
"multi_agent_v2"
]
- Provider: Ollama (
huihui_ai/Qwen3.8-abliterated:27b, providerollama-launch-codex-app) - Before: model asks to
spawn_agent→unsupported call: multi_agent_v1.spawn_agent - After fix: sub-agent is created and returns normally
Root cause
In ToolRouter::build_tool_call (FunctionCall branch, codex-rs/core/src/tools/router.rs), when no explicit namespace is present, the name is used as-is under the default namespace. For dotted names like multi_agent_v1.spawn_agent, this misses the handler registered under (namespace: "multi_agent_v1", name: "spawn_agent").
Fix
Split a dotted name at the first dot into (namespace, name) only when no explicit namespace is present:
- explicit
namespacealways wins (unchanged behavior) - plain non-dotted names keep the default namespace (unchanged)
- only dotted names with an empty/absent namespace are split
Diff: codex-rs/core/src/tools/router.rs +15/−1
Test: Added build_tool_call_splits_flat_dotted_name_when_namespace_is_absent (codex-rs/core/src/tools/router_tests.rs, +65) covering:
- flat dotted + no namespace →
(multi_agent_v1, spawn_agent) - plain name + no namespace → default namespace (functions)
- explicit namespace +
spawn_agent→ explicit namespace preserved
cargo test -p codex-core --lib build_tool_call_splits_flat_dotted_name_when_namespace_is_absent
# ... ok
Verification
Verified end-to-end in the desktop app: sub-agent created and waited on successfully.
Notes
- Fixes a whole class of namespaced tools (not just
multi_agent_v1), e.g. anymulti_agent_v1.*/multi_agent_v2.*/node_repl.jsflat names from providers that flatten the namespace into the name. - Does not touch the
CustomToolCallpath or explicit-namespace routing.
PR
I've prepared a PR in my fork: fedorbrain/codex#1
Since openai/codex limits PRs to collaborators, I can either:
- Open a cross-fork PR if added as a collaborator, or
- You can cherry-pick the commit
a0e8240from my fork.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in codex-rs/core/src/tools/router.rs at ToolRouter::build_tool_call and review the related test in codex-rs/core/src/tools/router_tests.rs. Run the named cargo test to verify flat dotted names split only when the namespace is absent, while plain names and explicit namespaces retain their existing routing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100