Failure Handling
When a gate fails, theretry block determines what happens next. The retry relaunches the step from GET with the current state — which has changed (error context, gate results are now available).
Without retry
If a step has noretry, any gate failure is fatal — the run stops immediately.
Basic retry
{error}, {diff}, {gate.*} are now in the state.
Overrides
Each retry entry declares a condition and optional keyword overrides:Condition types
Each entry has exactly one condition:exit is mandatory — a retry without exit is a dry-run error.
Overridable keywords
Retry entries can override these keywords:agent— switch to a different agent (escalation)session— forcenew(automatic when agent changes)worktree—resettogit reset --hard+git clean -fdprompt— replace the entire prompt (disables automatic retry context injection)
Sticky behavior
Overrides are sticky: an override activated at attempt N stays active for N+1, N+2, etc. A later entry overriding the same keyword replaces it.Validator conditions
A workflow validator can be used as a retry condition — the “agent assess” pattern:with: (separate from the step overrides). If its output is true, the entry’s overrides apply.
What happens on retry
- The state is updated with error context (
{error},{diff},{gate.*}) - Previous iteration keys are moved to
prevnamespace - The step relaunches from GET with the updated state
- If
worktree: resetis active, the worktree is reset to pre-step state - If the prompt is not overridden, the context builder injects a retry section automatically
- If the prompt is overridden, no automatic injection — the developer controls everything