Root agent gets stuck emitting `wait` instead of a requested second `spawn_agent` call
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- ai-infra-agents, devtools
Research direction
Start by inspecting the full session rollout under the Codex sessions directory, focusing on the recorded spawn_agent and wait function calls after the first child completes. Compare the expected typed delegation with the repeated wait calls using nonexistent cell_id values. Done means the second request emits spawn_agent or a concrete validation/runtime error instead of an unrelated wait call.
Written by the indexing model from the issue text.
Description
What version of Codex CLI is running?
codex-cli 0.145.0
Which model were you using?
gpt-5.6-sol
What platform is your computer?
Windows, Codex Desktop, PowerShell.
What happened?
After one successful typed subagent delegation, the root agent became stuck selecting the wait tool when it was explicitly asked to spawn a second typed subagent.
The first delegation worked. The full rollout contained a normal call similar to:
response_item.type = function_call
response_item.name = spawn_agent
arguments.agent_type = custom-planner
arguments.task_name = plan_task
arguments.fork_turns = none
Later, the user explicitly requested a second typed checker subagent. The assistant said it was starting that subagent, but the full session rollout recorded wait, not spawn_agent:
response_item.type = function_call
response_item.name = wait
arguments.cell_id = wrong
arguments.yield_time_ms = 1000
The tool then correctly returned:
exec cell wrong not found
This repeated many times with placeholder cell IDs such as wrong, dummy, x, and not-a-cell. Repeating the user request in a fresh turn did not recover tool selection. No second spawn_agent function call, child-start activity, or child thread appeared in the full rollout.
The typed subagent facility itself was available: the earlier spawn_agent succeeded in the same session. The visible schema required task_name; an initial call without it failed as expected, and retrying with task_name succeeded.
This is distinct from #34919. In #34919 the subagent genuinely spawns and the full rollout contains the spawn, while the public exec JSON stream omits it. Here the full rollout itself contains an incorrect wait function call and no second spawn occurred.
Steps to reproduce
- Start a Codex Desktop task with typed custom agents available.
- Call
spawn_agentwithagent_type,task_name, andfork_turns: none. - Wait for a relatively long-running child, including one or more
wait_agenttimeouts. - After the child completes, explicitly request a second typed subagent with a different
agent_typeandtask_name. - Inspect the full session rollout under the Codex sessions directory.
- Observe that subsequent attempted delegation may be emitted as
function_call.name: waitwith a nonexistentcell_id, and repeated requests do not recover.
I do not yet have a minimal deterministic reproduction outside the long conversation, so this may be model tool-call perseveration, app-side tool selection/serialization state, or interaction between the two.
Expected behavior
An explicit request to start the second typed subagent should emit a spawn_agent function call, or return a concrete spawn_agent validation/runtime error.
The root agent should not silently substitute the unrelated exec-cell wait tool, especially with a nonexistent placeholder cell_id.
Privacy note
All agent names, task names, paths, session identifiers, call identifiers, repository details, provider details, and timestamps above are sanitized or omitted. No credentials or user data are included.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
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.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·