Build
Outputs and retries
Validate final output, retry model calls, and inspect completed PHP runs.
Use output validation when downstream PHP code requires a predictable shape. Model retries cover transient request failures; keep retries for side-effecting tools inside the tool itself and make them idempotent.
The run result contains its status, steps, messages, normalized usage, stop reason, and final output. Inspect these fields instead of treating the final text as the complete execution record.
Use stop conditions to enforce budgets and errors and troubleshooting to choose recoverable failure behavior.
Last modified on July 26, 2026