Repository navigation
feat: MCP tool execution visualization in activity history - #717
Conversation
|
@claude review this PR |
|
Claude finished @itomek's task —— View job Reviewing PR #717
Code Review SummaryThis PR adds MCP tool execution visualization to the Agent Activity panel. The implementation is clean and well-structured. The changes follow existing patterns and include good test coverage. 🟢 Strengths
🟡 Minor Suggestions1. Consider defensive handling for missing registry entry ( mcp_server = _TOOL_REGISTRY.get(tool_name, {}).get("_mcp_server")This is already defensive with 2. Filter bar styling ( <input
type="text"
className="activity-filter-input"
value={toolNameFilter}
onChange={(e) => setToolNameFilter(e.target.value)}
// Add this
/>3. Type consistency ( latencyMs: event.latency_ms,Good that snake_case from SSE is mapped to camelCase for the step. This maintains TypeScript conventions. 🟢 Verified Behaviors
📋 Test CoverageThe new tests thoroughly cover:
✅ RecommendationLGTM - This PR is ready to merge pending manual verification of the UI behaviors listed in the test plan. |
acd7cef to
fcf4b4c
Compare
Add MCP server name, latency, and filtering to the Agent Activity panel.
MCP tool calls show a purple "via {server}" badge, latency in ms, and
start collapsed by default. A filter bar allows filtering by tool name
and status when 2+ tool steps exist.
Backend: SSE handler emits mcp_server on tool_start (via public
get_tool_metadata accessor) and latency_ms on tool_result (measured
with time.monotonic). Step capture persists both fields in the
agent_steps JSON blob.
Frontend: getToolMeta returns MCP-specific icon/color, FlowToolCard
renders server badge and latency, ActivityFilterBar provides tool name
and status filtering with useMemo.
Co-Authored-By: Tomasz Iniewicz <[email protected]>
fcf4b4c to
c4cfb66
Compare
…#712) print_tool_complete() was resetting _tool_start_time before pretty_print_json() could compute latency_ms, so the MCP tool latency was never emitted in SSE events or persisted in the DB. Swap the call order at both execution paths so the result (with latency) is emitted first, then the timer is reset. Also guard _execute_tool against None tool_name from LLM parsing. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
@claude review this PR |
|
Claude finished @itomek's task —— View job Reviewing PR #717
Code Review SummaryThis PR implements MCP tool execution visualization with server identification, latency metrics, filtering, and collapsed-by-default behavior. The implementation is well-architected and production-ready. 🟢 Strengths
🟡 Minor Observations1. Test registry cleanup pattern ( The @pytest.fixture
def mcp_tool(handler):
"""Register an MCP tool and ensure cleanup."""
registered = []
def register(name, server):
_TOOL_REGISTRY[name] = {...}
registered.append(name)
return name
yield register
for name in registered:
_TOOL_REGISTRY.pop(name, None)This is a minor suggestion — the current 2. MCP tool detection heuristic ( The frontend uses
3. Filter state persistence ( Filter state ( 🟢 Verified Behaviors
📋 Test CoverageThe tests comprehensively cover:
✅ RecommendationLGTM - This PR is ready to merge. The implementation is clean, well-tested, and follows existing patterns. The accessibility improvements (aria-labels) and the new |
Release notes for v0.17.2. See [docs/releases/v0.17.2.mdx](https://github.com/amd/gaia/blob/v0.17.2-release/docs/releases/v0.17.2.mdx) for the full body. **Headline features:** - One-click desktop installers for Windows, macOS, and Linux (#731 + #743) - Customizable agents and Builder Agent (#720) - MCP tool execution visibility in Agent Activity panel (#717) **Security:** RAG cache integrity verification (#722, closes #447) **Bug fixes:** drag-and-drop upload in any browser (#729), Linux install fixes (#743) **Release & CI:** unified publish workflow (#715), Claude review on fork PRs (#685), npm OIDC fix (#683), webui package.json sync (#682) Full changelog: v0.17.1...v0.17.2 --------- Co-authored-by: Tomasz Iniewicz <[email protected]>
Summary
Closes #712
time.monotonic()_TOOL_REGISTRYlookup (no fragile prefix parsing)Changes
src/gaia/ui/sse_handler.pymcp_serverontool_start,latency_msontool_resultsrc/gaia/ui/_chat_helpers.pymcpServer/latencyMsin captured stepssrc/gaia/ui/models.pyAgentStepResponsesrc/gaia/apps/webui/src/types/index.tsAgentStep+StreamEventsrc/gaia/apps/webui/src/components/ChatView.tsxmcp_server/latency_msin event handlerssrc/gaia/apps/webui/src/components/AgentActivity.tsxsrc/gaia/apps/webui/src/components/AgentActivity.csstests/unit/chat/ui/test_sse_handler.pytests/unit/chat/ui/test_models.pyTest plan
python -m pytest tests/unit/chat/ui/)npm run build)python util/lint.py --all --fix)gaia chat --ui→ configure MCP server → trigger tool calls → verify badge/latency/filter/collapseImages