mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-05 15:31:08 +00:00
Move exception handling to extensions
Refactors exception handling to use extension points and plugins. Moves InterventionException and HandledException into python/helpers/errors and routes exceptions from Agent (monologue and outer loops) through extension call points (monologue_exception, message_loop_exception, context_chain_exception) instead of inline handling. Removes inlined retry/critical logic and adds an error_retry plugin (reset counter + retry extension) as the retry implementation; also adds monologue_exception extensions to handle repairable, intervention, and critical exceptions. Adjusts extension hook naming in python/helpers/extension, adds agent-presence guards to several memory extensions, prevents a direct agent.handle_critical_exception call in TaskScheduler, renames a test file location, and fixes a webui modal path.
This commit is contained in:
parent
4691343d71
commit
0372c05f2b
22 changed files with 270 additions and 96 deletions
|
|
@ -933,8 +933,8 @@ class TaskScheduler:
|
|||
PrintStyle.warning(f"Fixing task state consistency: '{current_task.name}' state is not ERROR after failure")
|
||||
await self.update_task(task_uuid, state=TaskState.ERROR)
|
||||
|
||||
if agent:
|
||||
agent.handle_critical_exception(e)
|
||||
# if agent:
|
||||
# await agent.handle_critical_exception(e)
|
||||
finally:
|
||||
# Call on_finish for task-specific cleanup
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue