Skip to main content
Use the quickstart client. Replace uppercase IDs with your resource IDs.

Request errors

Inspect response.status and response.error for execution failures. Catch AgentRequestError for transport or request failures.
Error context is optional. An absent HTTP status can indicate a local timeout, abort, or network failure.

Local and protocol errors

Invalid options or IDs can throw TypeError before a request starts. Correct the argument instead of retrying it. AgentProtocolError indicates an invalid snapshot, response identity, or stream envelope. It can appear inside an AgentRequestError.cause chain. Retrieve the response by its saved ID. AgentEvent describes the transport envelope. agent.stream yields response views, not raw event objects.

Choose a recovery action

Rate limits and service failures

For 429, reduce concurrent requests and avoid immediate retry loops. For 5xx or network failures, allow time between attempts. When retrying a submission, preserve its original idempotency key and body. Correct validation or permission errors before retrying.

Capture useful diagnostics

Record the SDK version, method, HTTP status, error message, and response ID when available. For execution failures, record the response status and phase. Remove credentials and private prompt content before sharing logs.