Status: done
Implemented by subagent and committed as 43b0cc8 feat: add tool registry management.
Main-session verification:
uv run pytest tests/test_event_agent.py tests/test_debug_runtime.py tests/test_websocket_api.py
uv run pytest
Results:
20 passed, 1 warning in 0.26s23 passed, 1 warning in 0.27sReplace the single hardcoded EventAgent tool checkbox with a backend tool registry and UI-managed loaded tools.
The original requirement says the debug page must manage which tools are loaded in EventAgent. The MVP has only one hardcoded handoff_note checkbox and duplicated tool schema logic in runtime. This todo makes tools a backend-owned registry so UI and runtime share the same source of truth.
This todo covers:
This todo does not cover:
handoff_note.src/agent_lab/application/tools.pysrc/agent_lab/application/event_agent.pysrc/agent_lab/application/runtime.pysrc/agent_lab/presentation/web.pysrc/agent_lab/presentation/static/index.htmlsrc/agent_lab/presentation/static/app.jstests/test_event_agent.py, tests/test_debug_runtime.py, and tests/test_websocket_api.py.docs/plans/todos.md.Create a small registry in application layer:
ToolDefinition: name, description, parameters, handler.ToolRegistry.available_tools(): returns serializable public tool metadata.ToolRegistry.chat_tools(enabled_names): returns OpenAI-compatible tool definitions for selected names.ToolRegistry.handle(event): executes a registered tool and returns payload dict.handoff_note remains the only registered MVP tool. Unknown or disabled tools should still produce tool replies with explicit JSON errors, preserving current runtime behavior.
DebugRuntime should accept an optional registry, defaulting to the built-in registry. EventAgent should also receive that registry. The runtime should stop building tool schemas manually.
GET /api/tools returns:
[
{
"name": "handoff_note",
"description": "Send a note to the event agent.",
"parameters": { "type": "object", "properties": { "message": { "type": "string" } }, "required": ["message"] }
}
]
The static UI should fetch /api/tools on load, render a checkbox per tool, and send selected names in event_agent.enabled_tools.
GET /api/tools returns handoff_note metadata.tool-handoff-note checkbox dependency.application/tools.py.EventAgent and DebugRuntime to use ToolRegistry.GET /api/tools.Run:
uv run pytest tests/test_event_agent.py tests/test_debug_runtime.py tests/test_websocket_api.py
uv run pytest
Expected result:
event_agent.enabled_tools.