ddflow_wait
Waits until a work item can be claimed or any task is ready, then returns so agents avoid polling or asking when a claim is refused.
Instructions
Sleep until an item can be claimed -- or, with no item, until anything is ready -- and return the moment it can. Use it instead of polling or asking the operator when a claim was refused because another agent holds the item or overlapping files, or a dependency someone is working on is unfinished. Exit 0: claim now (it says what freed it). Exit 2: the deadline passed, or waiting cannot help (done, cycle, operator hold, a dependency nobody works on) and it says what to do instead. The holder is told you are waiting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | No | The item to wait for (default: anything ready). | |
| kind | No | 'task' (default) or 'phase'. | |
| poll | No | Seconds between log checks (default 2). | |
| globs | No | With item: the globs you will claim with (comma-separated or a JSON array), so ready means that claim will not be refused for them. | |
| phase | No | With no item: anything ready in this phase. | |
| timeout | No | Seconds to wait (default 300, at most 1800: a client may time a tool call out, so call again to keep waiting). 0 asks without waiting. | |
| as_agent | No | Subagent sharing the parent's connection: your own stable name, for this call only (see ddflow_identify). |