openai / openai/codex

bug: spawn_agent returns "unsupported call" for custom providers (flat dotted tool names)

Open
#42,488 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug custom-model subagent tool-calls
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, provider ollama-launch-codex-app)
  • Before: model asks to spawn_agentunsupported 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 namespace always 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:

  1. flat dotted + no namespace → (multi_agent_v1, spawn_agent)
  2. plain name + no namespace → default namespace (functions)
  3. 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. any multi_agent_v1.* / multi_agent_v2.* / node_repl.js flat names from providers that flatten the namespace into the name.
  • Does not touch the CustomToolCall path 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:

  1. Open a cross-fork PR if added as a collaborator, or
  2. You can cherry-pick the commit a0e8240 from my fork.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.