Outcomes and errors
Public documentation preview — incomplete. The SDK and optional AI SDK peers remain private and unpublished. This summary is not the complete failure-code or release-compatibility matrix.
router.call() and router.execute() return an ExecutionResult. It has an operation identity, stage, status, code, retryable and sideEffectState; some variants contain a tool ID, question, approval proposal, validation issues or result. Inspect status before reading a payload or retrying.
SideEffectState is exactly 'not_started' | 'unknown' | 'completed'. Unknown does not mean rolled back. After uncertain dispatch, use your own idempotency/reconciliation workflow before deciding whether another call is safe. A retryable flag does not override host approval or this uncertainty.
Malformed configuration/options can throw RouterConfigError (invalid_config, safe path). Operational selection/discovery methods can throw RouterOperationError with a typed stage/code/effect state instead of returning an ExecutionResult; handle both cases without leaking credentials or prompt content. Examples of operational codes include stale_tool, catalogue_stale, unsupported_schema, model_access_denied, provider_error, capacity_exceeded and cleanup_failed. This starter page is a summary, not the exhaustive union/code matrix required before full documentation acceptance.
Follow the first governed call, bounded execution and trust boundaries for context.