Skip to content

docs(codex-tools): fix subagent wait mapping to wait_agent - #963

Merged
arittr merged 2 commits into
obra:devfrom
leonsong09:fix/codex-wait-agent-mapping
Apr 28, 2026
Merged

arittr merged 2 commits into
obra:devfrom
leonsong09:fix/codex-wait-agent-mapping

Conversation

@leonsong09

@leonsong09 leonsong09 commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix the Codex tool mapping doc so subagent waiting uses wait_agent instead of the outdated wait.

Problem

skills/using-superpowers/references/codex-tools.md still described wait as the tool for collecting spawned subagent results.

That is outdated for current Codex. In current openai/codex, subagent waiting is handled by wait_agent, while wait is the separate exec-waiting surface (exec/wait) used for command / exec output.

Why this is correct

I verified this against the official openai/codex source corresponding to CLI 0.117.0 (rust-v0.117.0):

1. Codex defines a dedicated wait_agent tool for subagents

In the tool spec, Codex defines create_wait_agent_tool_v1() and create_wait_agent_tool_v2(), both named wait_agent:

  • name: "wait_agent".to_string()
  • description: "Wait for agents to reach a final status..."

Source:

2. Codex registers the subagent wait handler under wait_agent

The multi-agent handler registration uses wait_agent, not wait:

  • builder.register_handler("wait_agent", Arc::new(WaitAgentHandlerV2));

Source:

3. Codex separately defines wait as the exec wait tool

Codex also defines a different wait tool with exec-specific parameters such as:

  • cell_id
  • yield_time_ms
  • max_tokens
  • terminate

That is the command / exec waiting surface, not subagent waiting.

Source:

4. Codex tests explicitly distinguish the two tool surfaces

The tool-spec tests show:

  • multi-agent tools include:
    • ["spawn_agent", "send_input", "wait_agent", "close_agent"]
  • code-mode exec tools include:
    • ["exec", "wait"]

Sources:

5. Codex’s own code-mode description ties wait to exec/wait

Codex’s code-mode description says:

  • Use exec/wait tool to run all other tools...

So wait is explicitly associated with the exec/code-mode path.

Source:

6. The subagent wait implementation operates on agent targets and returns WaitAgentResult

The multi-agent wait implementation parses agent targets and returns WaitAgentResult, confirming that this path is specifically for waiting on spawned agents.

Sources:

7. Release reference

Official release tag for the version checked:

Changes

  • Updated Task returns result mapping from wait to wait_agent
  • Updated the multi-agent support note from spawn_agent, wait, close_agent to spawn_agent, wait_agent, close_agent
  • Added a short legacy note clarifying:
    • wait_agent = wait for spawned agents
    • wait (exec/wait) = wait for exec / command output

Scope

Minimal doc-only change in:

  • skills/using-superpowers/references/codex-tools.md

Verification

  • Checked the file diff
  • Ran:
git diff --check -- skills/using-superpowers/references/codex-tools.md

No diff formatting issues were reported.

@leonsong09

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look.

This is intended to be a very small doc-only correction:

  • one file changed
  • no behavior change
  • just aligns the Codex tool mapping with current openai/codex (rust-v0.117.0)

The key point is that current Codex distinguishes:

  • wait_agent for spawned subagents
  • wait / exec/wait for exec / command output

I included direct source links in the PR description for the tool spec, handler registration, tests, and the code-mode exec/wait description.

If the wording should be adjusted to better match the project's preferred terminology, I'm happy to update it.

@obra obra added documentation Improvements or additions to documentation codex Issues related to OpenAI Codex support subagents Retired: use skill:subagent-driven-development / skill:dispatching-parallel-agents pr-template-rules-ignored PR filed after template was added but didn't use it labels Mar 29, 2026
@arittr
arittr changed the base branch from main to dev April 28, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex Issues related to OpenAI Codex support documentation Improvements or additions to documentation pr-template-rules-ignored PR filed after template was added but didn't use it subagents Retired: use skill:subagent-driven-development / skill:dispatching-parallel-agents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants