Wait for Codex Agents (blocking)
agent_waitBlock execution until one or all subagent workers are ready, then get a lean per-worker status report. Pass every outstanding worker ID in a single call to avoid repeated stalls.
Instructions
Block until watched workers are ready. This blocks your whole turn, so use it only once you have run out of other work — while you still have anything to do, dispatch it and poll with agent_result instead. Workers do not need this call to stay alive or make progress. When you do wait, always pass every outstanding worker in agentIds rather than waiting on one at a time: waiting serially multiplies the stall by the number of workers. Returns when the mode condition is met or the timeout expires, with a lean report for each ready worker and each one still running.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | any (default) returns as soon as one watched worker is ready, so you can start using its result while the rest run. all returns when every watched worker is ready. | |
| until | No | terminal (default) waits for workers to finish, request also returns when one needs an approval answered, change returns on any new event. | |
| agentId | No | Single-worker shorthand for agentIds. | |
| agentIds | No | Watch a whole fleet in one call. Always prefer this over waiting on workers one at a time. | |
| afterCursor | No | ||
| timeoutSeconds | No | Seconds to block, default 10. A timeout is not a failure: the workers keep running and the result still reports where each one got to. |