Skip to content

Errors and retries ​

Errors normally contain a stable code, a human-readable detail, and optional extra. Branch on code.

CategoryHandling
400 / 422Fix request fields; do not retry unchanged
401 / 403Check key, delegation token, project, and scope
404Check the project and resource ID
409Read the resource state before acting again
429Honor Retry-After and back off
5xx / network failureRetry with a bounded backoff when safe

The current Node SDK does not automatically retry ordinary requests. SSE reconnects are handled by the event stream, but application code decides whether a POST is safe to repeat.

When a run fails, read failure_reason, failure_detail, and terminal_reason. awaiting_input means that an interaction is required, not that the network failed. The current DoAnything duration error is max_duration_exceeded; do not use the old duration_exceeded name.

For SSE reconnects, persist the last event ID and send it back:

http
GET /api/v1/projects/{pid}/do_anything/runs/{run_id}/events
Last-Event-ID: 142

Deduplicate events by ID after reconnecting.