Wait for approval
await_planWaits for a parked plan to be decided: the plan_id comes from a tool result with status pending_approval. Blocks server-side until the plan reaches a terminal status (applied, rejected, expired, failed) and returns that status. Every call returns within timeout_s (default 45, max 55); when the deadline passes first the result has timed_out=true with the plan still live, and a new call with the same plan_id resumes the wait. It reads durable state, so a timeout or a dropped connection loses nothing. A human approving in the dashboard is what executes the action; the plan proceeds whether or not anyone is waiting on it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan_id | Yes | the plan id a gated tool returned when it parked pending approval | |
| timeout_s | No | how long to block waiting for a decision, in seconds (default 45, max 55). The server always returns by this deadline; it never holds the request open indefinitely |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool | Yes | ||
| error | No | set when status is failed | |
| status | Yes | pending (awaiting a human in the dashboard — including after a drift refresh, see refresh_count), approved (decided, not yet run), rejected, expired (TTL lapsed before anyone decided), applied (approved and executed), or failed (approved but the fingerprint check or the executor itself failed — see error) | |
| plan_id | Yes | ||
| waited_s | Yes | seconds this call actually blocked before returning | |
| timed_out | No | true when the wait hit its deadline before the plan was decided — the plan is still live, call await_plan again with the same plan_id to keep waiting. Absent when status is terminal | |
| applied_at | No | ||
| created_at | Yes | ||
| decided_at | No | ||
| decided_by | No | ||
| expires_at | Yes | ||
| last_drift | No | what changed under the previously-approved card, prompting the latest refresh | |
| project_id | Yes | ||
| refresh_count | No | how many times an approve hit state drift and sent this plan back to pending with a rebuilt evidence card and a fresh TTL — status stays pending and still needs a human, keep polling; absent when it never happened | |
| retry_after_s | No | wait at least this many seconds before calling get_plan_status again; absent means the status is terminal and further calls are pointless. Prefer await_plan, which blocks server-side and needs no loop at all | |
| last_refreshed_at | No |