# Recovery & Failure Handling

> When something goes wrong, the system responds as follows.

Source: https://bifrost5.com/foundry/docs/recovery/

# Recovery Actions

Information

Restart on a brand-new machine with one command from your encrypted cloud backup, with Production-Grade.

[See editions](/foundry/docs/editions)

When something goes wrong, the system responds as follows.

| Scenario | Action |
| --- | --- |
| **Provider CLI crash** | Reload rules and state; reissue the last task. |
| **Supervisor restart** | Load last persisted state; resume from next task in queue. |
| **Task failed after max retries** | Task marked **blocked**; operator input required. |
| **Conflicting state** | Halt and request operator resolution. |
| **State persistence failure** | Halt immediately; do not advance. |

## Retry Behavior

- **Validation Failures**: Retries up to `max_retries` with feedback.

- **Ambiguity**: Generates clarification prompt.

- **Task Blocking**: After max retries, task is marked blocked; execution continues to next task.

## Safeguards

- **Task Retries**: Max retries per task (default: 3).

- **Interrogation Cycles**: Max 2 interrogation rounds per task.

- **Context Window**: Auto-rotates sessions when provider token limits are reached.

- **Resource Exhaustion**: Automatic exponential backoff.

After recovery, use **resume** (or restart the process/PM2) to continue. Audit logs and verbose logs provide the trail for debugging.
