mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-23 21:06:39 +00:00
Read the _error_retry retry limit from plugin settings instead of using the hardcoded single retry. Add config sanitization, preserve the default retry count in the settings UI, update plugin docs, and cover configured and zero-retry behavior with focused tests. |
||
|---|---|---|
| .. | ||
| extensions/python/_functions/agent/Agent | ||
| webui | ||
| default_config.yaml | ||
| plugin.yaml | ||
| README.md | ||
Error Retry
Retry after an unexpected critical exception so the agent has a chance to recover instead of failing immediately.
What It Does
This plugin hooks into the agent lifecycle and automatically retries the current loop when an unhandled critical exception occurs.
It does not retry exceptions that are already treated as controlled agent flow, such as:
HandledExceptionRepairableException
Main Behavior
- Counter reset per monologue
- Clears the retry counter at the start of a new monologue.
- Critical exception retry
- 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.
- Configurable retry count
- Uses the plugin's
retriessetting to control how many times recovery is attempted per monologue. The default is1.
- Uses the plugin's
Key Files
extensions/python/_functions/agent/Agent/monologue/start/_10_reset_critical_exception_counter.pyextensions/python/_functions/agent/Agent/handle_exception/end/_80_retry_critical_exception.py
Configuration Scope
- Settings section:
agent - Per-project config:
true - Per-agent config:
true - Always enabled:
false
Plugin Metadata
- Name:
_error_retry - Title:
Error Retry - Description: Retry on critical exceptions before failing.