Pull requests / #1112

#1112 web: make MCP tool activity readable and collapsible

open · @medking82 · 0 comentários · No GitHub

BenchmarksServer & API

Descrição

MCP-heavy answers currently stack one row per call with raw JSON result previews, making the answer hard to scan. This groups adjacent calls at the same answer position into a collapsed activity summary, shows a readable query/page subject, and keeps failed or skipped calls visible in the summary. Expanding a call still exposes the original arguments and the result sent to the model.

- Preserve answer/tool ordering and original call indexes. Group disclosure stays outside serialized chat history; open groups retain their internal scroll position and keyboard focus during repaint.
- Render result bodies only on expansion. Generic MCP tools remain supported; search/page tools get concise subjects and optional HTTP(S) source links without URL credentials.
- Use the existing CSS tokens and native details controls, including keyboard focus and reduced-motion behavior.

Validation on the rewritten main at `82f46a8c8f475f001ad76d92f58f4a4f8ffb0253`:

- `node --test tools/test_tool_activity.cjs tools/test_tool_activity_integration.cjs`: 13/13 passed. Includes actual app rendering/click/stream-event/history functions, ordering, disclosure persistence, focus restoration, escaped payloads and canonical source URLs.
- `node --check serve/web/app.js`, `node --check serve/web/tool-activity.js`, and `git diff --check`: passed.
- Four browser interaction checks passed in an isolated synthetic fixture using this branch's actual message renderer, handlers and CSS: nested raw details/source links, keyboard disclosure/focus, collapsed partial-failure summary, and separate failed/skipped rows. This did not exercise a live model or MCP transport.

This is a display-only contribution extracted from my fork. It changes no server endpoints, tool execution policy, loop limits, search defaults or resource allocation. Companion #1106 addresses Thinking scroll behavior independently; both touch the disclosure handler in app.js, so the explicit no-follow argument should be retained when integrating them.
## UI example

Illustrative screenshot of the current fork UI, rendered with entirely fictional projects, chats, messages and synthetic Monitor values. The grouped “Web research” card demonstrates the tool-activity presentation in this PR. The surrounding Project sidebar, Monitor panel, skills controls and resource controls are separate fork features, and the displayed numbers are demo data rather than benchmark results.

![Strata fork UI example with synthetic data](https://github.com/user-attachments/assets/c2229a63-5671-4235-89a5-72f309459027)

No site

Links install, modelos, releases.