Handle gateway failures
Gateway failures are rethrown asAgentGatewayError:
Handle schema failures
AgentSchemaValidationError identifies invalid tool input, tool output, progress events, or final output. Treat these as contract failures rather than transient model failures.
Inspect the failed run
When the runtime can checkpoint the failure, inspect:result.run.statusresult.run.error- the latest step’s
status,error, andmodelAttempts requestIdandnativeResponseIdfor correlation with gateway logs
Common checks
- Confirm
PHASEO_API_KEYis available to the server process. - Give each tool a unique, stable
id. - Use exact tool-call IDs when approving, rejecting, or supplying manual output.
- Keep model retries bounded; validation and approval failures should not retry blindly.
- Persist paused run state before returning control to a browser or queue worker.