pi_dispatch
Dispatch a task to a new pi sub-agent session running in the specified working directory. Returns a taskId immediately for later polling via pi_wait or pi_read.
Instructions
Dispatch a task to a new pi sub-agent session (spawns pi --mode rpc in cwd). Returns immediately with a taskId; use pi_wait to block for the result or pi_read to inspect progress.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Working directory pi operates in | |
| name | No | Optional human-readable task name | |
| task | Yes | Initial prompt / task description for pi | |
| model | No | Optional model override, e.g. 'anthropic/claude-sonnet-4' | |
| approve | No | Pass --approve to pi: trust project-local files (.pi/extensions etc.) for this run. | |
| interactive | No | Default true: blocking UI dialogs (confirm/select/input/editor) surface as pendingRequest for pi_respond. Set false for unattended runs: dialogs are auto-cancelled. |