Status: done
Convert EventAgent tool handler exceptions into structured tool-result errors instead of aborting or hanging the debug session.
Dynamic EventAgent tools will eventually call real code. A single tool exception should be visible to the ChatAgent as a tool reply, not break the WebSocket session or leave the runtime waiting forever for a tool response.
This todo covers:
Exception from registry tool handlers.ChatMessage(role="tool") containing a JSON error payload.This todo does not cover:
src/agent_lab/application/event_agent.pytests/test_event_agent.pytests/test_debug_runtime.pydocs/plans/todos.mdRuntimeError("boom").tool_result and reaches done.Catch handler exceptions in EventAgent.handle() and return payload:
{"tool": "handoff_note", "error": "tool handler failed: boom"}
Run:
uv run pytest tests/test_event_agent.py tests/test_debug_runtime.py
uv run pytest
Update this plan and docs/plans/todos.md, then commit.
Result:
RuntimeError("boom"), and runtime output collection timed out waiting for a missing tool reply.uv run pytest tests/test_event_agent.py tests/test_debug_runtime.py passed: 14 tests.uv run pytest passed: 37 tests, 1 existing Starlette deprecation warning.EventAgent.handle() now catches tool handler Exception and returns a structured tool reply with {"tool": name, "error": "tool handler failed: ..."}.tool_result, and continues to the next ChatAgent call.