multi_agent.usage_hint renders an invalid collaboration spawn recipient
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
When native multi-agent support is enabled, the developer multi_agent.usage_hint renders this direct-call example:
to=functions.collaboration.spawn_agent
But the actual successful tool invocation is registered as:
{"namespace":"collaboration","name":"spawn_agent"}
The rendered recipient therefore does not resolve to the registered top-level tool. It is also unavailable inside functions.exec, where ALL_TOOLS has no collaboration operations.
What end users may see
Delegation can fail silently: a requested subagent is not launched, while Codex instead runs a harmless no-op such as true, potentially repeatedly, or selects another unrelated execution or wait operation. The no-op manifestation is intermittent; the inconsistent rendered recipient is the confirmed defect.
For workflows pursuing an active /goal, this can stall required delegation. The bad recipient does not itself change goal status, but a coordinator can incorrectly interpret the resulting no-op or missing delegate result as a blocker and explicitly mark the active goal blocked. This was observed in the affected long-running workflow and later had to be corrected manually.
Environment
- Codex CLI
0.153.4 - Linux
- Native multi-agent support enabled
Reproduction
- Start Codex with agents enabled.
- Run a read-only prompt-render inspection, for example:
codex -c agents.enabled=true debug prompt-input "delegation probe"
- Inspect the native developer item of kind
multi_agent.usage_hint. - Observe
to=functions.collaboration.spawn_agent. - Inspect an actual successful direct spawn in the rollout: its function call uses namespace
collaborationand namespawn_agent, not the nestedfunctions.collaborationnamespace.
With agents.enabled=false, this usage hint is absent. Varying the agent-slot count changes the native hint, which further indicates that it is generated by the native prompt renderer.
Impact
In one long-running session, the invalid hint coexisted with the valid direct tool. The model repeatedly selected exec with cmd: "true" rather than attempting a collaboration call. The transcript proves the model selected exec; it does not prove that this exact invalid literal deterministically caused each no-op. However, the hint is objectively inconsistent with the registered tool contract and can direct a model toward an unreachable recipient.
Related behavior is reported in #35620 and #37113, but this report is specifically about the incorrect recipient rendered in multi_agent.usage_hint.
Expected behavior
Every rendered to= recipient should resolve exactly against the top-level tool catalog exposed to the model. The spawn example should use:
to=collaboration.spawn_agent
or whatever recipient form is derived from the registered tool contract.
Proposed fix and regression
Render collaboration examples from the registered top-level tool catalog instead of maintaining a hard-coded namespace string.
Add a renderer test that:
- Registers
collaboration.spawn_agent. - Renders
multi_agent.usage_hint. - Parses every
to=recipient and asserts that it resolves in the registered top-level catalog. - Asserts the spawn example is
collaboration.spawn_agent. - Renames the fixture namespace and verifies that the rendered recipient changes with it, proving it is derived rather than hard-coded.
- Verifies that disabling agents emits neither the multi-agent hint nor collaboration tools.
A black-box regression can assert that debug prompt-input contains the valid recipient and not functions.collaboration.spawn_agent.
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 with the debug prompt-input entry point and the multi_agent.usage_hint renderer, then inspect the registered top-level tool catalog and existing renderer tests. Done means the rendered spawn recipient resolves against that catalog, changes with the registered namespace, and the hint and collaboration tools are absent when agents are disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100