| 1 | # Error Retry |
| 2 | |
| 3 | Retry after an unexpected critical exception so the agent has a chance to recover instead of failing immediately. |
| 4 | |
| 5 | ## What It Does |
| 6 | |
| 7 | This plugin hooks into the agent lifecycle and automatically retries the current loop when an unhandled critical exception occurs. |
| 8 | |
| 9 | It does **not** retry exceptions that are already treated as controlled agent flow, such as: |
| 10 | |
| 11 | - `HandledException` |
| 12 | - `RepairableException` |
| 13 | |
| 14 | ## Main Behavior |
| 15 | |
| 16 | - **Counter reset per monologue** |
| 17 | - Clears the retry counter at the start of a new monologue. |
| 18 | - **Critical exception retry** |
| 19 | - On an unexpected exception, logs a warning, waits briefly, injects an agent-facing critical error message into history, and suppresses the original exception while retries remain. |
| 20 | - **Configurable retry count** |
| 21 | - Uses the plugin's `retries` setting to control how many times recovery is attempted per monologue. The default is `1`. |
| 22 | |
| 23 | ## Key Files |
| 24 | |
| 25 | - `extensions/python/_functions/agent/Agent/monologue/start/_10_reset_critical_exception_counter.py` |
| 26 | - `extensions/python/_functions/agent/Agent/handle_exception/end/_80_retry_critical_exception.py` |
| 27 | |
| 28 | ## Configuration Scope |
| 29 | |
| 30 | - **Settings section**: `agent` |
| 31 | - **Per-project config**: `true` |
| 32 | - **Per-agent config**: `true` |
| 33 | - **Always enabled**: `false` |
| 34 | |
| 35 | ## Plugin Metadata |
| 36 | |
| 37 | - **Name**: `_error_retry` |
| 38 | - **Title**: `Error Retry` |
| 39 | - **Description**: Retry on critical exceptions before failing. |