Error Handling
StateBase is designed for reliability, but network calls, transient backend issues, and user mistakes still happen. This guide covers every error class and how to handle each one.Error Classes
The SDKs raise typed errors:Basic Handling
Retry with Exponential Backoff
The SDK retries transient failures automatically with jittered backoff. To tune it:Manual Retry Pattern
When you need full control (e.g., long-running agents that shouldn’t auto-retry forever):Idempotency Keys
To safely retry non-idempotent writes, pass an idempotency key so a retried request doesn’t double-execute:Handling Partial Failures in Agents
For agent code, wrap tool calls and checkpoint around them (see Tool Calling):Async / TypeScript
Next Steps
- Python SDK: full client reference
- Reliability Guarantees: what StateBase guarantees on its side
- Incident Recovery: recovering from real production incidents