Convert tool execution exceptions into repairable tool errors instead of crashing monologue #190

Open
opened 2026-09-09 15:05:31 +00:00 by nsaspy · 0 comments
Owner

Summary

Defense-in-depth follow-up to #69.

In agent.py:1203 and agent.py:1483 the call response = await tool.execute(**tool_args) is wrapped only in try/finally — any exception (KeyError, ValueError, third-party bugs) bubbles to handle_exception() which re-raises and kills the monologue loop.

Suggested fix

Wrap with except Exception as e: returning Response(message=f"Tool {tool_name} failed: {e}", break_loop=False) so the model can repair its arguments on the next iteration. This single change converts every tool-arg crash class into a recoverable error.


Mirrored from lost-rob0t/a0-symbolics#78 via tracker sync.

## Summary Defense-in-depth follow-up to #69. In `agent.py:1203` and `agent.py:1483` the call `response = await tool.execute(**tool_args)` is wrapped only in `try/finally` — any exception (KeyError, ValueError, third-party bugs) bubbles to `handle_exception()` which re-raises and kills the monologue loop. ## Suggested fix Wrap with `except Exception as e:` returning `Response(message=f"Tool {tool_name} failed: {e}", break_loop=False)` so the model can repair its arguments on the next iteration. This single change converts every tool-arg crash class into a recoverable error. --- *Mirrored from [`lost-rob0t/a0-symbolics#78`](https://github.com/lost-rob0t/a0-symbolics/issues/78)* via tracker sync.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/a0-symbolics#190
No description provided.