A message that ran several tools renders one row per call. ui/src/chat/ChatBubble.vue puts every entry of the message's tools list inside one Trace and renders a ChatToolCall for each; ui/src/chat/ChatToolCall.vue gives each of those its own TraceLine (and its own TraceCollapsible when it has detail). A turn with a dozen searches therefore puts a dozen dim rows between the reader and the answer, and the transcript's height tracks tool count rather than answer length.
Group consecutive calls: two or more adjacent plain tool calls in a message collapse into a single row reading the count (e.g. '6 tool calls'), collapsed by default, expanding to the individual calls with the detail each already shows. A failed call is not hidden by the group - the collapsed row carries its error state and the call's name. A call that is still running keeps its running state visible while collapsed. A lone tool call and ChatNavChip rows render exactly as they do today.
Done when:
a message with three or more tool calls shows one collapsed row that expands to the calls
a message with a single tool call renders unchanged
a failed call inside a group is visible without expanding
vitest covers the grouping, the expansion and the failure case
Prior art: #840 did the same collapsing for the Telegram channel's live tool lines; that issue's body names the existing counted-line helper.
Imported from GitHub #1827 · type feature · priority P3 · created 2026-10-24 · closed 2026-10-26
A message that ran several tools renders one row per call. `ui/src/chat/ChatBubble.vue` puts every entry of the message's `tools` list inside one `Trace` and renders a `ChatToolCall` for each; `ui/src/chat/ChatToolCall.vue` gives each of those its own `TraceLine` (and its own `TraceCollapsible` when it has detail). A turn with a dozen searches therefore puts a dozen dim rows between the reader and the answer, and the transcript's height tracks tool count rather than answer length.
Group consecutive calls: two or more adjacent plain tool calls in a message collapse into a single row reading the count (e.g. '6 tool calls'), collapsed by default, expanding to the individual calls with the detail each already shows. A failed call is not hidden by the group - the collapsed row carries its error state and the call's name. A call that is still running keeps its running state visible while collapsed. A lone tool call and `ChatNavChip` rows render exactly as they do today.
Done when:
- a message with three or more tool calls shows one collapsed row that expands to the calls
- a message with a single tool call renders unchanged
- a failed call inside a group is visible without expanding
- vitest covers the grouping, the expansion and the failure case
Prior art: #840 did the same collapsing for the Telegram channel's live tool lines; that issue's body names the existing counted-line helper.
---
_Imported from GitHub #1827 · type feature · priority P3 · created 2026-10-24 · closed 2026-10-26_
sam
added the lowfeature labels 2026-10-27 13:41:28 +00:00
PRD — Chat UI: collapse consecutive tool calls into one counted row (#1827)
Status: proposed · Scope: the chat transcript's tool rows only (ui/src/chat/). No server, protocol or Go change.
Correction to the request
Most of this feature is already in the tree, so the work is a gap-fix, not a build.
ui/src/chat/ChatBubble.vue:36-48 already folds consecutive calls into runs: a call carrying path (a ChatNavChip) stands alone and ends the run; :60-61 renders ChatToolGroup for a run longer than one call and ChatToolCall otherwise.
ui/src/chat/ChatToolGroup.vue already wraps a run in one TraceCollapsible, expands to the existing ChatToolCall rows, and tints the header on failure.
So two of the four done-when items already hold: 3+ calls show one row that expands, and a single call (and a nav chip) renders as before. Three defects remain, plus a fourth found while reading:
Failure is wrong in two directions.ChatToolGroup.vue:34 opens the group by default (:default-open="anyFailed"), so a failed run is not "collapsed by default"; and the title at :25-29 is per-name counts only (shell ×1, curl ×1), so the red row never names the call that failed. The issue wants the row closed, red, and naming the failed call.
Running is not implemented. The group computes only anyFailed (:30), so a still-running call inside a collapsed group loses its state. TraceLine.vue supports status="running" (shimmer over trace-title), and ChatToolCall.vue:53 derives it (!outcome && !failed && streaming), but the group cannot see it.
The label is counts-per-name, not a count. The issue asks for 6 tool calls; the code renders shell ×12, find ×1.
The two components duplicate the field-reading rules and have already diverged.ChatToolCall.vue:32-54 derives name/failed/outcome from summary|Summary|text|err|Err; ChatToolGroup.vue:22-30 reads only err|Err|failed. The group therefore cannot tell whether a call has an outcome, which is why (2) is unfixable without moving the rules out.
Proposed solution
One pure module, ui/src/chat/tools.ts (the pattern ui/src/chat/attachment.ts and ui/src/dashboard/activity-group.ts already set — no Vue imports):
Export
Rule
toolName(tool)
name || Name || tool || "tool"
toolFailed(tool)
Boolean(err || Err || failed)
toolOutcome(tool)
summary || Summary || text || err || Err || ""
toolRunning(tool, streaming)
!outcome && !failed && streaming
groupToolRuns(tools)
today's ChatBubble.vue:36-48 logic, moved verbatim
toolRunTitle(run)
${n} tool call${n===1?"":"s"}, plus — failed: + failing names (in order) when any call failed
toolRunStatus(run, streaming)
"error" if any call failed, else "running" if any call is running, else undefined
ChatToolGroup.vue then becomes: title = toolRunTitle(tools), status = toolRunStatus(tools, streaming), TraceLine :status="status", and no default-open (always starts closed). ChatToolCall.vue keeps its own rendering and imports the four per-call helpers. ChatBubble.vue drops its local runs computed and its computed import and uses groupToolRuns.
Resulting behaviour:
Case
Collapsed row
State
Initially
1 plain call
ChatToolCall, unchanged (name, its own detail collapsible)
unchanged
unchanged
2+ plain calls, all fine
6 tool calls
dim
closed
2+ plain calls, one failed
6 tool calls — failed: shell
red (status="error")
closed
2+ plain calls, one still running (live turn)
6 tool calls
shimmering (status="running")
closed
2+ calls, one failed and one running
… — failed: shell
red (error wins)
closed
ChatNavChip call
chip, never grouped, ends the run
unchanged
unchanged
Files and components affected
File
Change
ui/src/chat/tools.ts
new, ~55 lines
ui/src/chat/ChatToolGroup.vue
script reduced to two calls into the module (~25 lines changed); drop :default-open
ui/src/chat/ChatToolCall.vue
three computeds replaced by helper calls (~10 lines removed); template untouched
ui/src/chat/ChatBubble.vue
runs computed (13 lines) and computed import removed
rebuilt by task ui, committed in the same commit (tools/uidist.sh fails on a stale bundle)
ui/package.json is untouched: no new dependency.
Decisions taken (overrule if you disagree)
Label is the flat count, 6 tool calls, with the failing call's name appended on failure. The per-name breakdown (shell ×12) is dropped from the collapsed row because the expanded rows already name every call. Alternative, if the breakdown is valued more than the width: 13 tool calls — shell ×12, find ×1.
Threshold stays at 2, per the issue body ("two or more adjacent plain tool calls"); the done-when's "three or more" is the test case, not the rule.
A failed group no longer auto-opens. This reverses shipping behaviour at ChatToolGroup.vue:34; the error state plus the failing name in the header is what keeps the failure visible. ChatToolCall's own :default-open="failed" (a lone call with detail) is unchanged.
Grouping applies during a live turn too, so a second call arriving folds the lone row into a counted row. The running shimmer on the group's title is what preserves liveness while closed.
No CHANGELOG.md edit: release sections are generated at release time (RELEASING.md:57-58).
Acceptance criteria
A message with 3+ plain tool calls renders one TraceCollapsible row reading 3 tool calls (singular 1 tool call, but a single call never groups), closed on mount, expanding to one ChatToolCall per call with its existing detail.
A message with exactly one plain tool call renders byte-identical markup to today (no group component, no count title).
A group containing a failed call renders status="error" and names that call in the title, closed; a second failed call is also named.
A group in a live turn whose last call has no outcome renders status="running" while closed; a call with an outcome, or a non-streaming turn, does not.
A path call renders as a ChatNavChip and is never folded into a group; it splits a run ([a,b], [chip], [c]).
ui/test/chat-tools.test.ts covers, table-driven: run splitting including the nav-chip split and the untouched singleton; the title for 1/2/3/6 calls and for a failing and multi-failing run; toolRunStatus for all-clean, failed, running, and failed+running; toolRunning false when an outcome or a failure is present. Run with npm test (node --test --experimental-strip-types test/*.test.ts).
task test:ui passes (npm test + vue-tsc --build --force), and task ui:check passes with the rebuilt ui/dist committed.
Deviation to acknowledge: the issue says "vitest covers the grouping, the expansion and the failure case". ui/ has no vitest, no jsdom and no @vue/test-utils (ui/package.json devDependencies: @types/node, @vitejs/plugin-vue, @vue/tsconfig, typescript, vite, vue-tsc), and nothing in ui/test/ mounts a component. The grouping, the failure label/status and the input to expansion (defaultOpen false, the run passed through) are covered by node --test on the pure module; the reka-ui Collapsible's actual open/close is covered by nothing, as today. Adding vitest+jsdom+test-utils for one assertion is a new toolchain for no gain.
Non-goals
Not changing ChatToolCall's per-call rendering: parameters, the code-block detail, the > params formatting, the failure auto-open for a lone call.
Not grouping nav chips, and not grouping across messages or turns.
Not persisting expansion state; not adding a "collapse all" control.
Not touching Trace, TraceLine, TraceCollapsible or any other component in ui/src/components/ui/.
Not touching the Go side. #840's countedToolLine (internal/channels/telegram/live.go:274) is Go and collapses repeated identical failures by FailureKey into ×N — a different rule, so only the idea transfers, nothing is reusable.
No new dependency, no test runner change, no CHANGELOG.md edit.
Estimated diff size
~+140 / −35 hand-written lines over 5 files (tools.ts new, ChatToolGroup.vue ~25, ChatToolCall.vue ~10, ChatBubble.vue ~15, test ~80), plus the regenerated ui/dist — which shows up in review as a rewritten single minified line in ui/dist/assets/index.js. No new asset files. One commit.
Risks and what is unverified
ChatToolGroup.vue is tracked in .git/index, but I could not run git log/git status here, so I cannot say whether the current grouping is committed or a local change, and I could not confirm whether the committed ui/dist already contains it (the bundle is minified into one 77 KB line and my greps for the group's markup were inconclusive). task ui:check status for this tree is therefore unknown; the plan requires task ui regardless.
No e2e test touches chat tool rows (grep over e2e/ for tool call|tool_calls|ChatTool: no matches), so verification of the rendered result is manual: a live turn with several searches, plus a /dashboard-nav message, plus a forced failing tool.
The live-turn running state depends on streaming reaching ChatBubble — it does, only for the live row (ChatTranscript.vue:105, :streaming="row.live"), so a running group is only ever the streaming turn.
Decide in chat or on the dashboard.
_sam wrote (originally 2026-10-24):_
**archie's PRD is ready -- awaiting your go/no-go.**
# PRD — Chat UI: collapse consecutive tool calls into one counted row (#1827)
**Status:** proposed · **Scope:** the chat transcript's tool rows only (`ui/src/chat/`). No server, protocol or Go change.
## Correction to the request
Most of this feature is already in the tree, so the work is a gap-fix, not a build.
- `ui/src/chat/ChatBubble.vue:36-48` already folds consecutive calls into runs: a call carrying `path` (a `ChatNavChip`) stands alone and ends the run; `:60-61` renders `ChatToolGroup` for a run longer than one call and `ChatToolCall` otherwise.
- `ui/src/chat/ChatToolGroup.vue` already wraps a run in one `TraceCollapsible`, expands to the existing `ChatToolCall` rows, and tints the header on failure.
So two of the four done-when items already hold: 3+ calls show one row that expands, and a single call (and a nav chip) renders as before. Three defects remain, plus a fourth found while reading:
1. **Failure is wrong in two directions.** `ChatToolGroup.vue:34` opens the group by default (`:default-open="anyFailed"`), so a failed run is not "collapsed by default"; and the title at `:25-29` is per-name counts only (`shell ×1, curl ×1`), so the red row never names the call that failed. The issue wants the row closed, red, *and* naming the failed call.
2. **Running is not implemented.** The group computes only `anyFailed` (`:30`), so a still-running call inside a collapsed group loses its state. `TraceLine.vue` supports `status="running"` (shimmer over `trace-title`), and `ChatToolCall.vue:53` derives it (`!outcome && !failed && streaming`), but the group cannot see it.
3. **The label is counts-per-name, not a count.** The issue asks for `6 tool calls`; the code renders `shell ×12, find ×1`.
4. **The two components duplicate the field-reading rules and have already diverged.** `ChatToolCall.vue:32-54` derives name/failed/outcome from `summary|Summary|text|err|Err`; `ChatToolGroup.vue:22-30` reads only `err|Err|failed`. The group therefore cannot tell whether a call has an outcome, which is why (2) is unfixable without moving the rules out.
## Proposed solution
**One pure module, `ui/src/chat/tools.ts`** (the pattern `ui/src/chat/attachment.ts` and `ui/src/dashboard/activity-group.ts` already set — no Vue imports):
| Export | Rule |
| --- | --- |
| `toolName(tool)` | `name \|\| Name \|\| tool \|\| "tool"` |
| `toolFailed(tool)` | `Boolean(err \|\| Err \|\| failed)` |
| `toolOutcome(tool)` | `summary \|\| Summary \|\| text \|\| err \|\| Err \|\| ""` |
| `toolRunning(tool, streaming)` | `!outcome && !failed && streaming` |
| `groupToolRuns(tools)` | today's `ChatBubble.vue:36-48` logic, moved verbatim |
| `toolRunTitle(run)` | `${n} tool call${n===1?"":"s"}`, plus ` — failed: ` + failing names (in order) when any call failed |
| `toolRunStatus(run, streaming)` | `"error"` if any call failed, else `"running"` if any call is running, else `undefined` |
`ChatToolGroup.vue` then becomes: `title = toolRunTitle(tools)`, `status = toolRunStatus(tools, streaming)`, `TraceLine :status="status"`, and **no `default-open`** (always starts closed). `ChatToolCall.vue` keeps its own rendering and imports the four per-call helpers. `ChatBubble.vue` drops its local `runs` computed and its `computed` import and uses `groupToolRuns`.
Resulting behaviour:
| Case | Collapsed row | State | Initially |
| --- | --- | --- | --- |
| 1 plain call | `ChatToolCall`, unchanged (name, its own detail collapsible) | unchanged | unchanged |
| 2+ plain calls, all fine | `6 tool calls` | dim | closed |
| 2+ plain calls, one failed | `6 tool calls — failed: shell` | red (`status="error"`) | closed |
| 2+ plain calls, one still running (live turn) | `6 tool calls` | shimmering (`status="running"`) | closed |
| 2+ calls, one failed and one running | `… — failed: shell` | red (error wins) | closed |
| `ChatNavChip` call | chip, never grouped, ends the run | unchanged | unchanged |
## Files and components affected
| File | Change |
| --- | --- |
| `ui/src/chat/tools.ts` | new, ~55 lines |
| `ui/src/chat/ChatToolGroup.vue` | script reduced to two calls into the module (~25 lines changed); drop `:default-open` |
| `ui/src/chat/ChatToolCall.vue` | three computeds replaced by helper calls (~10 lines removed); template untouched |
| `ui/src/chat/ChatBubble.vue` | `runs` computed (13 lines) and `computed` import removed |
| `ui/test/chat-tools.test.ts` | new, ~80 lines, `node:test` + `node:assert/strict`, table-driven |
| `ui/dist/assets/index.js` (+ regenerated bundle) | rebuilt by `task ui`, committed in the same commit (`tools/uidist.sh` fails on a stale bundle) |
`ui/package.json` is untouched: **no new dependency**.
## Decisions taken (overrule if you disagree)
- **Label is the flat count**, `6 tool calls`, with the failing call's name appended on failure. The per-name breakdown (`shell ×12`) is dropped from the collapsed row because the expanded rows already name every call. Alternative, if the breakdown is valued more than the width: `13 tool calls — shell ×12, find ×1`.
- **Threshold stays at 2**, per the issue body ("two or more adjacent plain tool calls"); the done-when's "three or more" is the test case, not the rule.
- **A failed group no longer auto-opens.** This reverses shipping behaviour at `ChatToolGroup.vue:34`; the error state plus the failing name in the header is what keeps the failure visible. `ChatToolCall`'s own `:default-open="failed"` (a lone call with detail) is unchanged.
- **Grouping applies during a live turn too**, so a second call arriving folds the lone row into a counted row. The running shimmer on the group's title is what preserves liveness while closed.
- **No `CHANGELOG.md` edit**: release sections are generated at release time (`RELEASING.md:57-58`).
## Acceptance criteria
1. A message with 3+ plain tool calls renders one `TraceCollapsible` row reading `3 tool calls` (singular `1 tool call`, but a single call never groups), closed on mount, expanding to one `ChatToolCall` per call with its existing detail.
2. A message with exactly one plain tool call renders byte-identical markup to today (no group component, no count title).
3. A group containing a failed call renders `status="error"` and names that call in the title, closed; a second failed call is also named.
4. A group in a live turn whose last call has no outcome renders `status="running"` while closed; a call with an outcome, or a non-streaming turn, does not.
5. A `path` call renders as a `ChatNavChip` and is never folded into a group; it splits a run (`[a,b], [chip], [c]`).
6. `ui/test/chat-tools.test.ts` covers, table-driven: run splitting including the nav-chip split and the untouched singleton; the title for 1/2/3/6 calls and for a failing and multi-failing run; `toolRunStatus` for all-clean, failed, running, and failed+running; `toolRunning` false when an outcome or a failure is present. Run with `npm test` (`node --test --experimental-strip-types test/*.test.ts`).
7. `task test:ui` passes (`npm test` + `vue-tsc --build --force`), and `task ui:check` passes with the rebuilt `ui/dist` committed.
**Deviation to acknowledge:** the issue says "vitest covers the grouping, the expansion and the failure case". `ui/` has no vitest, no jsdom and no `@vue/test-utils` (`ui/package.json` devDependencies: `@types/node`, `@vitejs/plugin-vue`, `@vue/tsconfig`, `typescript`, `vite`, `vue-tsc`), and nothing in `ui/test/` mounts a component. The grouping, the failure label/status and the *input* to expansion (`defaultOpen` false, the run passed through) are covered by `node --test` on the pure module; the reka-ui Collapsible's actual open/close is covered by nothing, as today. Adding vitest+jsdom+test-utils for one assertion is a new toolchain for no gain.
## Non-goals
- Not changing `ChatToolCall`'s per-call rendering: parameters, the code-block detail, the `> params` formatting, the failure auto-open for a lone call.
- Not grouping nav chips, and not grouping across messages or turns.
- Not persisting expansion state; not adding a "collapse all" control.
- Not touching `Trace`, `TraceLine`, `TraceCollapsible` or any other component in `ui/src/components/ui/`.
- Not touching the Go side. #840's `countedToolLine` (`internal/channels/telegram/live.go:274`) is Go and collapses *repeated identical failures* by `FailureKey` into `×N` — a different rule, so only the idea transfers, nothing is reusable.
- No new dependency, no test runner change, no `CHANGELOG.md` edit.
## Estimated diff size
~+140 / −35 hand-written lines over 5 files (`tools.ts` new, `ChatToolGroup.vue` ~25, `ChatToolCall.vue` ~10, `ChatBubble.vue` ~15, test ~80), plus the regenerated `ui/dist` — which shows up in review as a rewritten single minified line in `ui/dist/assets/index.js`. No new asset files. One commit.
## Risks and what is unverified
- `ChatToolGroup.vue` is tracked in `.git/index`, but I could not run `git log`/`git status` here, so I cannot say whether the current grouping is committed or a local change, and I could not confirm whether the committed `ui/dist` already contains it (the bundle is minified into one 77 KB line and my greps for the group's markup were inconclusive). `task ui:check` status for this tree is therefore unknown; the plan requires `task ui` regardless.
- No e2e test touches chat tool rows (`grep` over `e2e/` for `tool call|tool_calls|ChatTool`: no matches), so verification of the rendered result is manual: a live turn with several searches, plus a `/dashboard`-nav message, plus a forced failing tool.
- The live-turn running state depends on `streaming` reaching `ChatBubble` — it does, only for the live row (`ChatTranscript.vue:105`, `:streaming="row.live"`), so a running group is only ever the streaming turn.
_Decide in chat or on the dashboard._
PRD — Chat UI: collapse consecutive tool calls into one counted row (issue #1827)
Problem
A reply that ran a dozen tools puts a dozen dim rows between the reader and the answer, so transcript height tracks tool count rather than answer length.
Most of the grouping already ships on main (0f75475). The issue body's description of ui/src/chat/ChatBubble.vue ("every entry inside one Trace, a ChatToolCall for each") is stale:
ChatBubble.vue builds segments[]: text up to each call's text_offset, then the calls, folding adjacent plain calls (!tool.path) into one { tools: ToolCall[] } segment. A ChatNavChip (a path call) always starts its own segment and ends the run.
ChatBubble.vue:79-81 renders <ChatToolGroup v-if="segment.tools.length > 1"> and falls back to a lone ChatToolCall otherwise, so the collapse threshold is 2, and a lone call or a nav chip renders as today.
ChatToolGroup.vue renders N tool call(s) in a TraceCollapsible, closed by default, expanding to one ChatToolCall each (each keeping its own detail collapsible).
So the issue's done-when items 1 and 2 already hold. Two behaviours are genuinely missing, and one item is unbuildable as written:
Running state is invisible while collapsed.ChatToolGroup.vue sets :status="anyFailed ? 'error' : undefined". streaming is only forwarded to the last inner ChatToolCall, which is hidden until the row is opened. A live turn running tools shows a neutral wrench line with no shimmer and no spinner. Live frames do carry TextOffset and Failed (internal/webui/api_chat.go:371-377), so groups form during streaming too — this is the case an operator watches.
Failure is surfaced by auto-expanding (:default-open="anyFailed"), and the collapsed row reads only the count. The issue asks for the opposite: stay collapsed, carry the error state, and name the failing call in the row.
"vitest covers …" cannot be met in this tree. There is no vitest, no @vue/test-utils and no DOM environment. ui/package.json has "test": "node --test --experimental-strip-types test/*.test.ts"; every ui/test/*.test.ts imports a pure .ts module (e.g. chat-attachment.test.ts → src/chat/attachment.ts); no test mounts a .vue file. Adding vitest + DOM + @vue/test-utils contradicts AGENTS.md ("Cheapest option first", "Do not add a dependency for a few lines of code") and ui/AGENTS.md ("Use browser checks for rendered behavior").
Proposed solution
One small component change plus a test decision. No new service, RPC, contract, dependency or component.
Derive status from the same rules ChatToolCall.vue already uses: failed = Boolean(tool.err || tool.Err || tool.failed); running = !!streaming && !failed(last) && !outcome(last) where outcome is summary || Summary || text || err || Err — only the last call of a live run can be running, which is why streaming is forwarded to it alone.
Trigger line: :status="failed ? 'error' : running ? 'running' : undefined". TraceLine maps error to text-destructive and running to a shimmer on TraceTitle; TraceCollapsibleTrigger already propagates the error colour via has-[[data-status=error]]:text-destructive.
Icon: CircleX when failed, LoaderCircle class="animate-spin" when running, Wrench otherwise — the same vocabulary as a single call row.
Title: keep the count, append the failing call's name (tool.name || tool.Name || tool.tool || "tool"), e.g. 6 tool calls · web_search failed; when more than one call in the run failed, 6 tool calls · 2 failed. Implementation note: render the name in a plain <span class="font-mono"> so the inherited destructive colour applies — TraceDescription hard-codes text-muted-foreground/70 and has no consumers today.
Drop :default-open="anyFailed" so the group stays closed on failure.
ChatBubble.vue, ChatToolCall.vue, ChatNavChip.vue, the Trace* primitives and the transcript hold no other change. state.ts and the wire shape are untouched.
Files and components affected
Path
Change
ui/src/chat/ChatToolGroup.vue
status/title/icon/drop auto-open (the whole production change)
ui/test/chat-tools.test.ts(only if decision 1 goes to the helper route)
node --test cases for the fold and classification
ui/src/chat/tools.ts(same condition)
pure module extracted from ChatBubble.vue + the name/failed/outcome rules duplicated in ChatToolCall.vue, with ChatToolCall.vue/ChatToolGroup.vue/ChatBubble.vue as consumers
e2e/checks/chat-tools.cjs(recommended regardless)
one browser check, modelled on e2e/checks/accessibility.cjs:47 which already stubs **/api/chat/stream
ui/dist/
regenerated with task ui; task ui:check is in task check (Taskfile.yml:296) and rejects a stale dist, so a source change without a rebuild fails the gate
Acceptance criteria
A message with three adjacent tool calls renders one collapsed row reading 3 tool calls; opening it shows the three calls, each with the detail it shows today.
A message with one tool call renders exactly as today (one row, its own status and argument), and a ChatNavChip row is untouched and outside any group.
A failed call inside a group is visible without expanding: the closed row is in the error colour and names the failing call.
A call still running keeps a visible running state while the group is closed (spinner + shimmer), and settles to its outcome.
npm test, npm run typecheck, task ui and task check pass on the change.
Automated coverage replaces the issue's "vitest" line as decided below: either ui/test/chat-tools.test.ts under node --test (grouping, lone call, failure/running classification) plus e2e/checks/chat-tools.cjs (collapsed, expanded, failure row), or the browser check alone.
Explicit non-goals
No change to how tools reach the browser, to ChatToolCall's detail rendering, or to the navigate chip.
No new grouping across non-adjacent calls, across messages, or across a ChatNavChip.
No change to Telegram's countedToolLine (internal/channels/telegram/live.go:274) — prior art only; it is Go-side and not reusable here.
No new component, Trace* variant or design-system addition; no dependency.
Not addressing the separate oddity that a live turn's tool frames are placed by text_offset while deltas are still arriving (existing behaviour, out of scope).
Estimated diff size
Production: ~15 lines in ChatToolGroup.vue.
With the helper route (decision 1b): +~55 lines for ui/src/chat/tools.ts, −~40 lines removed from ChatBubble.vue/ChatToolCall.vue, so net production still ≈60 lines across three files.
Tests: ~50 lines for e2e/checks/chat-tools.cjs (+~55 for ui/test/chat-tools.test.ts under 1b).
Plus the regenerated ui/dist bundle, committed.
Roughly 60–170 lines of hand-written diff depending on the test decision; comfortably under the 100-line "stop and reassess" line for production code either way.
Open decisions (recommended answers)
Test mechanism. (a) e2e/checks/chat-tools.cjs only; (b) that check plus extracting ui/src/chat/tools.ts and covering it with node --test; (c) add vitest + @vue/test-utils + a DOM environment. Recommend (b), with (a) as the acceptable cheap fallback and (c) rejected: it introduces a test stack for one component and contradicts both AGENTS.md files, and node --test + a browser check already cover the three cases the issue names. Note the honest gap either way: npm test is in the gate (Taskfile.yml:295) but e2e/ is not, so the rendered checks only protect regressions if run at release (node e2e/run.cjs --record <version> all). Caveat on (b): ui/AGENTS.md says not to extract production helpers solely to make them testable — the extraction is defensible because it removes the name/outcome/failed triple currently duplicated between ChatToolCall.vue and ChatToolGroup.vue, and the extracted module must stay free of runtime vue/@/ imports so node --test --experimental-strip-types can load it (the attachment.ts/turn.ts pattern).
Failed call. Stay collapsed with the name and error state in the row (what the issue asks) or keep today's auto-expand? Recommend the issue's version. This is a behaviour change to something already shipped, and it costs one thing: today's expansion shows the failing call's parameters and error text with no click, and after the change the operator must click once. Worth stating in the commit message.
Threshold. The body says "two or more", done-when says "three or more". Current code collapses at two. Recommend keeping two and reading "three or more" as the case the demo must show, which is what acceptance criterion 1 does.
Row wording.6 tool calls · web_search failed, or 6 tool calls · 2 failed when several failed? Recommend that, since it names one call unambiguously and never lies about a multi-failure run. Switch to a count-only row (6 tool calls · 1 failed) if the maintainer prefers not to privilege one name.
Priority: priority::low per the issue, and nothing in the tree competes — this is presentation, not a bug that loses work or shows nothing.
Decide in chat or on the dashboard.
_sam wrote (originally 2026-10-25):_
**archie's PRD is ready -- awaiting your go/no-go.**
# PRD — Chat UI: collapse consecutive tool calls into one counted row (issue #1827)
## Problem
A reply that ran a dozen tools puts a dozen dim rows between the reader and the answer, so transcript height tracks tool count rather than answer length.
**Most of the grouping already ships on `main` (0f75475).** The issue body's description of `ui/src/chat/ChatBubble.vue` ("every entry inside one Trace, a `ChatToolCall` for each") is stale:
- `ChatBubble.vue` builds `segments[]`: text up to each call's `text_offset`, then the calls, folding **adjacent plain calls** (`!tool.path`) into one `{ tools: ToolCall[] }` segment. A `ChatNavChip` (a `path` call) always starts its own segment and ends the run.
- `ChatBubble.vue:79-81` renders `<ChatToolGroup v-if="segment.tools.length > 1">` and falls back to a lone `ChatToolCall` otherwise, so the collapse threshold is **2**, and a lone call or a nav chip renders as today.
- `ChatToolGroup.vue` renders `N tool call(s)` in a `TraceCollapsible`, closed by default, expanding to one `ChatToolCall` each (each keeping its own detail collapsible).
So the issue's done-when items 1 and 2 already hold. Two behaviours are genuinely missing, and one item is unbuildable as written:
1. **Running state is invisible while collapsed.** `ChatToolGroup.vue` sets `:status="anyFailed ? 'error' : undefined"`. `streaming` is only forwarded to the last inner `ChatToolCall`, which is hidden until the row is opened. A live turn running tools shows a neutral wrench line with no shimmer and no spinner. Live frames do carry `TextOffset` and `Failed` (`internal/webui/api_chat.go:371-377`), so groups form during streaming too — this is the case an operator watches.
2. **Failure is surfaced by auto-expanding** (`:default-open="anyFailed"`), and the collapsed row reads only the count. The issue asks for the opposite: stay collapsed, carry the error state, and name the failing call in the row.
3. **"vitest covers …" cannot be met in this tree.** There is no vitest, no `@vue/test-utils` and no DOM environment. `ui/package.json` has `"test": "node --test --experimental-strip-types test/*.test.ts"`; every `ui/test/*.test.ts` imports a pure `.ts` module (e.g. `chat-attachment.test.ts` → `src/chat/attachment.ts`); no test mounts a `.vue` file. Adding vitest + DOM + `@vue/test-utils` contradicts `AGENTS.md` ("Cheapest option first", "Do not add a dependency for a few lines of code") and `ui/AGENTS.md` ("Use browser checks for rendered behavior").
## Proposed solution
One small component change plus a test decision. No new service, RPC, contract, dependency or component.
**`ui/src/chat/ChatToolGroup.vue` (~15 lines changed):**
- Derive status from the same rules `ChatToolCall.vue` already uses: `failed = Boolean(tool.err || tool.Err || tool.failed)`; `running = !!streaming && !failed(last) && !outcome(last)` where `outcome` is `summary || Summary || text || err || Err` — only the last call of a live run can be running, which is why `streaming` is forwarded to it alone.
- Trigger line: `:status="failed ? 'error' : running ? 'running' : undefined"`. `TraceLine` maps `error` to `text-destructive` and `running` to a shimmer on `TraceTitle`; `TraceCollapsibleTrigger` already propagates the error colour via `has-[[data-status=error]]:text-destructive`.
- Icon: `CircleX` when failed, `LoaderCircle class="animate-spin"` when running, `Wrench` otherwise — the same vocabulary as a single call row.
- Title: keep the count, append the failing call's name (`tool.name || tool.Name || tool.tool || "tool"`), e.g. `6 tool calls · web_search failed`; when more than one call in the run failed, `6 tool calls · 2 failed`. Implementation note: render the name in a plain `<span class="font-mono">` so the inherited destructive colour applies — `TraceDescription` hard-codes `text-muted-foreground/70` and has no consumers today.
- Drop `:default-open="anyFailed"` so the group stays closed on failure.
`ChatBubble.vue`, `ChatToolCall.vue`, `ChatNavChip.vue`, the `Trace*` primitives and the transcript hold no other change. `state.ts` and the wire shape are untouched.
## Files and components affected
| Path | Change |
| --- | --- |
| `ui/src/chat/ChatToolGroup.vue` | status/title/icon/drop auto-open (the whole production change) |
| `ui/test/chat-tools.test.ts` *(only if decision 1 goes to the helper route)* | `node --test` cases for the fold and classification |
| `ui/src/chat/tools.ts` *(same condition)* | pure module extracted from `ChatBubble.vue` + the name/failed/outcome rules duplicated in `ChatToolCall.vue`, with `ChatToolCall.vue`/`ChatToolGroup.vue`/`ChatBubble.vue` as consumers |
| `e2e/checks/chat-tools.cjs` *(recommended regardless)* | one browser check, modelled on `e2e/checks/accessibility.cjs:47` which already stubs `**/api/chat/stream` |
| `ui/dist/` | regenerated with `task ui`; `task ui:check` is in `task check` (`Taskfile.yml:296`) and rejects a stale dist, so a source change without a rebuild fails the gate |
## Acceptance criteria
1. A message with three adjacent tool calls renders one collapsed row reading `3 tool calls`; opening it shows the three calls, each with the detail it shows today.
2. A message with one tool call renders exactly as today (one row, its own status and argument), and a `ChatNavChip` row is untouched and outside any group.
3. A failed call inside a group is visible without expanding: the closed row is in the error colour and names the failing call.
4. A call still running keeps a visible running state while the group is closed (spinner + shimmer), and settles to its outcome.
5. `npm test`, `npm run typecheck`, `task ui` and `task check` pass on the change.
6. Automated coverage replaces the issue's "vitest" line as decided below: either `ui/test/chat-tools.test.ts` under `node --test` (grouping, lone call, failure/running classification) plus `e2e/checks/chat-tools.cjs` (collapsed, expanded, failure row), or the browser check alone.
## Explicit non-goals
- No change to how tools reach the browser, to `ChatToolCall`'s detail rendering, or to the `navigate` chip.
- No new grouping across non-adjacent calls, across messages, or across a `ChatNavChip`.
- No change to Telegram's `countedToolLine` (`internal/channels/telegram/live.go:274`) — prior art only; it is Go-side and not reusable here.
- No new component, `Trace*` variant or design-system addition; no dependency.
- Not addressing the separate oddity that a live turn's tool frames are placed by `text_offset` while deltas are still arriving (existing behaviour, out of scope).
## Estimated diff size
- Production: **~15 lines in `ChatToolGroup.vue`**.
- With the helper route (decision 1b): +~55 lines for `ui/src/chat/tools.ts`, −~40 lines removed from `ChatBubble.vue`/`ChatToolCall.vue`, so net production still ≈60 lines across three files.
- Tests: ~50 lines for `e2e/checks/chat-tools.cjs` (+~55 for `ui/test/chat-tools.test.ts` under 1b).
- Plus the regenerated `ui/dist` bundle, committed.
Roughly 60–170 lines of hand-written diff depending on the test decision; comfortably under the 100-line "stop and reassess" line for production code either way.
## Open decisions (recommended answers)
1. **Test mechanism.** (a) `e2e/checks/chat-tools.cjs` only; (b) that check **plus** extracting `ui/src/chat/tools.ts` and covering it with `node --test`; (c) add vitest + `@vue/test-utils` + a DOM environment. **Recommend (b)**, with (a) as the acceptable cheap fallback and (c) rejected: it introduces a test stack for one component and contradicts both `AGENTS.md` files, and `node --test` + a browser check already cover the three cases the issue names. Note the honest gap either way: `npm test` is in the gate (`Taskfile.yml:295`) but `e2e/` is not, so the rendered checks only protect regressions if run at release (`node e2e/run.cjs --record <version> all`). Caveat on (b): `ui/AGENTS.md` says not to extract production helpers solely to make them testable — the extraction is defensible because it removes the `name`/`outcome`/`failed` triple currently duplicated between `ChatToolCall.vue` and `ChatToolGroup.vue`, and the extracted module must stay free of runtime `vue`/`@/` imports so `node --test --experimental-strip-types` can load it (the `attachment.ts`/`turn.ts` pattern).
2. **Failed call.** Stay collapsed with the name and error state in the row (what the issue asks) or keep today's auto-expand? **Recommend the issue's version.** This is a behaviour change to something already shipped, and it costs one thing: today's expansion shows the failing call's parameters and error text with no click, and after the change the operator must click once. Worth stating in the commit message.
3. **Threshold.** The body says "two or more", done-when says "three or more". Current code collapses at two. **Recommend keeping two** and reading "three or more" as the case the demo must show, which is what acceptance criterion 1 does.
4. **Row wording.** `6 tool calls · web_search failed`, or `6 tool calls · 2 failed` when several failed? **Recommend that**, since it names one call unambiguously and never lies about a multi-failure run. Switch to a count-only row (`6 tool calls · 1 failed`) if the maintainer prefers not to privilege one name.
Priority: `priority::low` per the issue, and nothing in the tree competes — this is presentation, not a bug that loses work or shows nothing.
_Decide in chat or on the dashboard._
Already implemented on main, so closing rather than building it again.
2a405bd4 group consecutive tool calls
2feffd9b summarise the run as one line
9b512cb4 N calls with one status row per call
4719b9cf interleave calls at their text offset
Current code: ui/src/chat/ChatToolGroup.vue renders the counted row ("N tool calls", auto-opened if any call in the run failed) and ui/src/chat/ChatBubble.vue:39-60,79-88 splits the reply into segments at each tool's text_offset, grouping consecutive non-navigation calls.
Follow-up worth filing: no vitest covers ChatToolGroup or the segment split.
_sam wrote (originally 2026-10-26):_
Already implemented on main, so closing rather than building it again.
- `2a405bd4` group consecutive tool calls
- `2feffd9b` summarise the run as one line
- `9b512cb4` N calls with one status row per call
- `4719b9cf` interleave calls at their text offset
Current code: `ui/src/chat/ChatToolGroup.vue` renders the counted row ("N tool calls", auto-opened if any call in the run failed) and `ui/src/chat/ChatBubble.vue:39-60,79-88` splits the reply into segments at each tool's `text_offset`, grouping consecutive non-navigation calls.
Follow-up worth filing: no vitest covers `ChatToolGroup` or the segment split.
Closing: this task was declined in archie (actioned by d898c8c8-47f4-5d6c-945a-2e7dc98ca1c1 (user), no authorising principal). Reopen the issue to have archie pick it up again.
_sam wrote (originally 2026-10-26):_
Closing: this task was declined in archie (actioned by d898c8c8-47f4-5d6c-945a-2e7dc98ca1c1 (user), no authorising principal). Reopen the issue to have archie pick it up again.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
A message that ran several tools renders one row per call.
ui/src/chat/ChatBubble.vueputs every entry of the message'stoolslist inside oneTraceand renders aChatToolCallfor each;ui/src/chat/ChatToolCall.vuegives each of those its ownTraceLine(and its ownTraceCollapsiblewhen it has detail). A turn with a dozen searches therefore puts a dozen dim rows between the reader and the answer, and the transcript's height tracks tool count rather than answer length.Group consecutive calls: two or more adjacent plain tool calls in a message collapse into a single row reading the count (e.g. '6 tool calls'), collapsed by default, expanding to the individual calls with the detail each already shows. A failed call is not hidden by the group - the collapsed row carries its error state and the call's name. A call that is still running keeps its running state visible while collapsed. A lone tool call and
ChatNavChiprows render exactly as they do today.Done when:
Prior art: #840 did the same collapsing for the Telegram channel's live tool lines; that issue's body names the existing counted-line helper.
Imported from GitHub #1827 · type feature · priority P3 · created 2026-10-24 · closed 2026-10-26
sam wrote (originally 2026-10-24):
archie's PRD is ready -- awaiting your go/no-go.
PRD — Chat UI: collapse consecutive tool calls into one counted row (#1827)
Status: proposed · Scope: the chat transcript's tool rows only (
ui/src/chat/). No server, protocol or Go change.Correction to the request
Most of this feature is already in the tree, so the work is a gap-fix, not a build.
ui/src/chat/ChatBubble.vue:36-48already folds consecutive calls into runs: a call carryingpath(aChatNavChip) stands alone and ends the run;:60-61rendersChatToolGroupfor a run longer than one call andChatToolCallotherwise.ui/src/chat/ChatToolGroup.vuealready wraps a run in oneTraceCollapsible, expands to the existingChatToolCallrows, and tints the header on failure.So two of the four done-when items already hold: 3+ calls show one row that expands, and a single call (and a nav chip) renders as before. Three defects remain, plus a fourth found while reading:
ChatToolGroup.vue:34opens the group by default (:default-open="anyFailed"), so a failed run is not "collapsed by default"; and the title at:25-29is per-name counts only (shell ×1, curl ×1), so the red row never names the call that failed. The issue wants the row closed, red, and naming the failed call.anyFailed(:30), so a still-running call inside a collapsed group loses its state.TraceLine.vuesupportsstatus="running"(shimmer overtrace-title), andChatToolCall.vue:53derives it (!outcome && !failed && streaming), but the group cannot see it.6 tool calls; the code rendersshell ×12, find ×1.ChatToolCall.vue:32-54derives name/failed/outcome fromsummary|Summary|text|err|Err;ChatToolGroup.vue:22-30reads onlyerr|Err|failed. The group therefore cannot tell whether a call has an outcome, which is why (2) is unfixable without moving the rules out.Proposed solution
One pure module,
ui/src/chat/tools.ts(the patternui/src/chat/attachment.tsandui/src/dashboard/activity-group.tsalready set — no Vue imports):toolName(tool)name || Name || tool || "tool"toolFailed(tool)Boolean(err || Err || failed)toolOutcome(tool)summary || Summary || text || err || Err || ""toolRunning(tool, streaming)!outcome && !failed && streaminggroupToolRuns(tools)ChatBubble.vue:36-48logic, moved verbatimtoolRunTitle(run)${n} tool call${n===1?"":"s"}, plus— failed:+ failing names (in order) when any call failedtoolRunStatus(run, streaming)"error"if any call failed, else"running"if any call is running, elseundefinedChatToolGroup.vuethen becomes:title = toolRunTitle(tools),status = toolRunStatus(tools, streaming),TraceLine :status="status", and nodefault-open(always starts closed).ChatToolCall.vuekeeps its own rendering and imports the four per-call helpers.ChatBubble.vuedrops its localrunscomputed and itscomputedimport and usesgroupToolRuns.Resulting behaviour:
ChatToolCall, unchanged (name, its own detail collapsible)6 tool calls6 tool calls — failed: shellstatus="error")6 tool callsstatus="running")… — failed: shellChatNavChipcallFiles and components affected
ui/src/chat/tools.tsui/src/chat/ChatToolGroup.vue:default-openui/src/chat/ChatToolCall.vueui/src/chat/ChatBubble.vuerunscomputed (13 lines) andcomputedimport removedui/test/chat-tools.test.tsnode:test+node:assert/strict, table-drivenui/dist/assets/index.js(+ regenerated bundle)task ui, committed in the same commit (tools/uidist.shfails on a stale bundle)ui/package.jsonis untouched: no new dependency.Decisions taken (overrule if you disagree)
6 tool calls, with the failing call's name appended on failure. The per-name breakdown (shell ×12) is dropped from the collapsed row because the expanded rows already name every call. Alternative, if the breakdown is valued more than the width:13 tool calls — shell ×12, find ×1.ChatToolGroup.vue:34; the error state plus the failing name in the header is what keeps the failure visible.ChatToolCall's own:default-open="failed"(a lone call with detail) is unchanged.CHANGELOG.mdedit: release sections are generated at release time (RELEASING.md:57-58).Acceptance criteria
TraceCollapsiblerow reading3 tool calls(singular1 tool call, but a single call never groups), closed on mount, expanding to oneChatToolCallper call with its existing detail.status="error"and names that call in the title, closed; a second failed call is also named.status="running"while closed; a call with an outcome, or a non-streaming turn, does not.pathcall renders as aChatNavChipand is never folded into a group; it splits a run ([a,b], [chip], [c]).ui/test/chat-tools.test.tscovers, table-driven: run splitting including the nav-chip split and the untouched singleton; the title for 1/2/3/6 calls and for a failing and multi-failing run;toolRunStatusfor all-clean, failed, running, and failed+running;toolRunningfalse when an outcome or a failure is present. Run withnpm test(node --test --experimental-strip-types test/*.test.ts).task test:uipasses (npm test+vue-tsc --build --force), andtask ui:checkpasses with the rebuiltui/distcommitted.Deviation to acknowledge: the issue says "vitest covers the grouping, the expansion and the failure case".
ui/has no vitest, no jsdom and no@vue/test-utils(ui/package.jsondevDependencies:@types/node,@vitejs/plugin-vue,@vue/tsconfig,typescript,vite,vue-tsc), and nothing inui/test/mounts a component. The grouping, the failure label/status and the input to expansion (defaultOpenfalse, the run passed through) are covered bynode --teston the pure module; the reka-ui Collapsible's actual open/close is covered by nothing, as today. Adding vitest+jsdom+test-utils for one assertion is a new toolchain for no gain.Non-goals
ChatToolCall's per-call rendering: parameters, the code-block detail, the> paramsformatting, the failure auto-open for a lone call.Trace,TraceLine,TraceCollapsibleor any other component inui/src/components/ui/.countedToolLine(internal/channels/telegram/live.go:274) is Go and collapses repeated identical failures byFailureKeyinto×N— a different rule, so only the idea transfers, nothing is reusable.CHANGELOG.mdedit.Estimated diff size
~+140 / −35 hand-written lines over 5 files (
tools.tsnew,ChatToolGroup.vue~25,ChatToolCall.vue~10,ChatBubble.vue~15, test ~80), plus the regeneratedui/dist— which shows up in review as a rewritten single minified line inui/dist/assets/index.js. No new asset files. One commit.Risks and what is unverified
ChatToolGroup.vueis tracked in.git/index, but I could not rungit log/git statushere, so I cannot say whether the current grouping is committed or a local change, and I could not confirm whether the committedui/distalready contains it (the bundle is minified into one 77 KB line and my greps for the group's markup were inconclusive).task ui:checkstatus for this tree is therefore unknown; the plan requirestask uiregardless.grepovere2e/fortool call|tool_calls|ChatTool: no matches), so verification of the rendered result is manual: a live turn with several searches, plus a/dashboard-nav message, plus a forced failing tool.streamingreachingChatBubble— it does, only for the live row (ChatTranscript.vue:105,:streaming="row.live"), so a running group is only ever the streaming turn.Decide in chat or on the dashboard.
sam wrote (originally 2026-10-25):
archie's PRD is ready -- awaiting your go/no-go.
PRD — Chat UI: collapse consecutive tool calls into one counted row (issue #1827)
Problem
A reply that ran a dozen tools puts a dozen dim rows between the reader and the answer, so transcript height tracks tool count rather than answer length.
Most of the grouping already ships on
main(0f75475). The issue body's description ofui/src/chat/ChatBubble.vue("every entry inside one Trace, aChatToolCallfor each") is stale:ChatBubble.vuebuildssegments[]: text up to each call'stext_offset, then the calls, folding adjacent plain calls (!tool.path) into one{ tools: ToolCall[] }segment. AChatNavChip(apathcall) always starts its own segment and ends the run.ChatBubble.vue:79-81renders<ChatToolGroup v-if="segment.tools.length > 1">and falls back to a loneChatToolCallotherwise, so the collapse threshold is 2, and a lone call or a nav chip renders as today.ChatToolGroup.vuerendersN tool call(s)in aTraceCollapsible, closed by default, expanding to oneChatToolCalleach (each keeping its own detail collapsible).So the issue's done-when items 1 and 2 already hold. Two behaviours are genuinely missing, and one item is unbuildable as written:
ChatToolGroup.vuesets:status="anyFailed ? 'error' : undefined".streamingis only forwarded to the last innerChatToolCall, which is hidden until the row is opened. A live turn running tools shows a neutral wrench line with no shimmer and no spinner. Live frames do carryTextOffsetandFailed(internal/webui/api_chat.go:371-377), so groups form during streaming too — this is the case an operator watches.:default-open="anyFailed"), and the collapsed row reads only the count. The issue asks for the opposite: stay collapsed, carry the error state, and name the failing call in the row.@vue/test-utilsand no DOM environment.ui/package.jsonhas"test": "node --test --experimental-strip-types test/*.test.ts"; everyui/test/*.test.tsimports a pure.tsmodule (e.g.chat-attachment.test.ts→src/chat/attachment.ts); no test mounts a.vuefile. Adding vitest + DOM +@vue/test-utilscontradictsAGENTS.md("Cheapest option first", "Do not add a dependency for a few lines of code") andui/AGENTS.md("Use browser checks for rendered behavior").Proposed solution
One small component change plus a test decision. No new service, RPC, contract, dependency or component.
ui/src/chat/ChatToolGroup.vue(~15 lines changed):ChatToolCall.vuealready uses:failed = Boolean(tool.err || tool.Err || tool.failed);running = !!streaming && !failed(last) && !outcome(last)whereoutcomeissummary || Summary || text || err || Err— only the last call of a live run can be running, which is whystreamingis forwarded to it alone.:status="failed ? 'error' : running ? 'running' : undefined".TraceLinemapserrortotext-destructiveandrunningto a shimmer onTraceTitle;TraceCollapsibleTriggeralready propagates the error colour viahas-[[data-status=error]]:text-destructive.CircleXwhen failed,LoaderCircle class="animate-spin"when running,Wrenchotherwise — the same vocabulary as a single call row.tool.name || tool.Name || tool.tool || "tool"), e.g.6 tool calls · web_search failed; when more than one call in the run failed,6 tool calls · 2 failed. Implementation note: render the name in a plain<span class="font-mono">so the inherited destructive colour applies —TraceDescriptionhard-codestext-muted-foreground/70and has no consumers today.:default-open="anyFailed"so the group stays closed on failure.ChatBubble.vue,ChatToolCall.vue,ChatNavChip.vue, theTrace*primitives and the transcript hold no other change.state.tsand the wire shape are untouched.Files and components affected
ui/src/chat/ChatToolGroup.vueui/test/chat-tools.test.ts(only if decision 1 goes to the helper route)node --testcases for the fold and classificationui/src/chat/tools.ts(same condition)ChatBubble.vue+ the name/failed/outcome rules duplicated inChatToolCall.vue, withChatToolCall.vue/ChatToolGroup.vue/ChatBubble.vueas consumerse2e/checks/chat-tools.cjs(recommended regardless)e2e/checks/accessibility.cjs:47which already stubs**/api/chat/streamui/dist/task ui;task ui:checkis intask check(Taskfile.yml:296) and rejects a stale dist, so a source change without a rebuild fails the gateAcceptance criteria
3 tool calls; opening it shows the three calls, each with the detail it shows today.ChatNavChiprow is untouched and outside any group.npm test,npm run typecheck,task uiandtask checkpass on the change.ui/test/chat-tools.test.tsundernode --test(grouping, lone call, failure/running classification) pluse2e/checks/chat-tools.cjs(collapsed, expanded, failure row), or the browser check alone.Explicit non-goals
ChatToolCall's detail rendering, or to thenavigatechip.ChatNavChip.countedToolLine(internal/channels/telegram/live.go:274) — prior art only; it is Go-side and not reusable here.Trace*variant or design-system addition; no dependency.text_offsetwhile deltas are still arriving (existing behaviour, out of scope).Estimated diff size
ChatToolGroup.vue.ui/src/chat/tools.ts, −~40 lines removed fromChatBubble.vue/ChatToolCall.vue, so net production still ≈60 lines across three files.e2e/checks/chat-tools.cjs(+~55 forui/test/chat-tools.test.tsunder 1b).ui/distbundle, committed.Roughly 60–170 lines of hand-written diff depending on the test decision; comfortably under the 100-line "stop and reassess" line for production code either way.
Open decisions (recommended answers)
e2e/checks/chat-tools.cjsonly; (b) that check plus extractingui/src/chat/tools.tsand covering it withnode --test; (c) add vitest +@vue/test-utils+ a DOM environment. Recommend (b), with (a) as the acceptable cheap fallback and (c) rejected: it introduces a test stack for one component and contradicts bothAGENTS.mdfiles, andnode --test+ a browser check already cover the three cases the issue names. Note the honest gap either way:npm testis in the gate (Taskfile.yml:295) bute2e/is not, so the rendered checks only protect regressions if run at release (node e2e/run.cjs --record <version> all). Caveat on (b):ui/AGENTS.mdsays not to extract production helpers solely to make them testable — the extraction is defensible because it removes thename/outcome/failedtriple currently duplicated betweenChatToolCall.vueandChatToolGroup.vue, and the extracted module must stay free of runtimevue/@/imports sonode --test --experimental-strip-typescan load it (theattachment.ts/turn.tspattern).6 tool calls · web_search failed, or6 tool calls · 2 failedwhen several failed? Recommend that, since it names one call unambiguously and never lies about a multi-failure run. Switch to a count-only row (6 tool calls · 1 failed) if the maintainer prefers not to privilege one name.Priority:
priority::lowper the issue, and nothing in the tree competes — this is presentation, not a bug that loses work or shows nothing.Decide in chat or on the dashboard.
sam wrote (originally 2026-10-26):
Already implemented on main, so closing rather than building it again.
2a405bd4group consecutive tool calls2feffd9bsummarise the run as one line9b512cb4N calls with one status row per call4719b9cfinterleave calls at their text offsetCurrent code:
ui/src/chat/ChatToolGroup.vuerenders the counted row ("N tool calls", auto-opened if any call in the run failed) andui/src/chat/ChatBubble.vue:39-60,79-88splits the reply into segments at each tool'stext_offset, grouping consecutive non-navigation calls.Follow-up worth filing: no vitest covers
ChatToolGroupor the segment split.sam wrote (originally 2026-10-26):
Closing: this task was declined in archie (actioned by d898c8c8-47f4-5d6c-945a-2e7dc98ca1c1 (user), no authorising principal). Reopen the issue to have archie pick it up again.