Files
pipelines/docs/notes/chat-tool-group.md
T
alan 7fbbd95374 chat: one tool-call summary chip per turn, opening the call list
The chat transcript no longer renders a chip per tool call: `ToolCalls`
(`android/.../ui/chat/ChatToolCalls.kt`) now draws a single summary chip
reading `N tools called` (`1 tool called` for one) as the turn's only
tool-call surface. While the turn streams the chip shows the call count
growing and the existing spinner while any call is in flight, plus the
existing `· long` mark for a running call past `TOOL_LONG_RUNNING_MILLIS`;
both are gated on the turn still streaming (`live = streaming` in
`AgentTurnItem`), so a settled chip never spins or fakes a long mark.

Tapping the chip opens the existing `ToolPanel` as a popup listing every
call of the turn, in the order the agent made them: one independently
collapsible row per call naming it, showing its one-line detail, its
`+N -M` edit stat and its duration, expanding in place to the
pretty-printed INPUT, the synthesised edit diff, then the ERROR block for
a failed call or the OUTPUT (`(no output)` when empty). The list is
bounded by the new `TOOL_PANEL_MAX_HEIGHT_DP` (`Dimens.kt`, purpose-named)
and scrolls inside the panel, so many calls never grow the popup past the
window nor re-flow the transcript. The chip announces the count ("N tool
calls, expand for details") through the app's accessibility treatment.

Pure logic lives in `ChatFormat.kt` (`toolCallsLabel`,
`toolCallsAnnouncement`, `toolCallCount`, `toolsRunning`, `toolCallRow`)
with unit cases added to the existing `ChatFormatTest`; no raw dimension
was introduced, so `DimensTest` is unchanged.

Checked for staleness: the packaged authoring skill references
(`internal/author/skill/references/`) and the packaged templates carry no
Android-chat content, so neither needs updating — this change is
`android/`-only. The shared docs this change makes stale
(`android/README.md`'s "Tool-call chips and the expandable panel" section
and `docs/chat-verification.md`'s tool-chip row) are recorded in
`docs/notes/chat-tool-group.md` for the single `docs-fold` writer rather
than edited here.
2026-10-18 09:58:28 +01:00

49 lines
2.9 KiB
Markdown

# Chat transcript: one tool-call summary chip per agent turn
## What this item changed
`android/` only — the chat transcript's tool-call surface.
- **One chip per turn.** `ui/chat/ChatToolCalls.kt` no longer renders a chip per
call in a `FlowRow`; `ToolCalls` renders a single summary chip reading
`N tools called` (`1 tool called` for one), the transcript's only tool-call
surface. The individual calls are not chips any more.
- **Live summary.** The chip shows the existing spinner while any call is in
flight and a `· long` mark while a running call has passed
`TOOL_LONG_RUNNING_MILLIS`; both are gated on the turn still streaming
(`AgentTurnItem` passes `live = streaming`), so a settled turn never shows the
spinner or a long mark for a stored call whose status is stale.
- **Popup list.** Tapping the chip opens `ToolPanel` as a bounded
(`TOOL_PANEL_MAX_HEIGHT_DP`), scrollable list of one collapsible row per call in
the order the agent made them. A row shows the call's name, its one-line detail,
its `+N -M` stat for an edit and its duration, and expands in place to the
pretty-printed INPUT, the synthesised diff for an `edit`-family call, then the
ERROR block for a failed call or the OUTPUT (or `(no output)`). Rows expand and
collapse independently, and the popup still does not re-flow or scroll the
transcript.
- **Pure logic.** `ui/chat/ChatFormat.kt` adds `toolCallsLabel`,
`toolCallsAnnouncement` (the chip's accessibility line, e.g. "6 tool calls,
expand for details"), `toolCallCount`, `toolsRunning` and `toolCallRow` (the
per-row detail derivation), with cases added to `ChatFormatTest`.
- **Geometry.** `ui/theme/Dimens.kt` adds `TOOL_PANEL_MAX_HEIGHT_DP`; no raw
literal was introduced, so `DimensTest` is unchanged.
## Shared documents this change makes stale
`android/README.md` describes the surface this item changed. The note is written
here rather than edited in place; the `docs-fold` writer should update it.
- `android/README.md` — the section **"Tool-call chips and the expandable panel
(16 Oct 2026)"** and its **Grouped chips** bullet ("A run of consecutive `tool`
parts in one assistant turn is now one `FlowRow` of compact chips") describe the
per-call chips this item removed. It should say the turn renders one summary
chip (`N tools called`) as the transcript's only tool-call surface, and that
tapping it opens one popup listing every call of the turn as independently
collapsible rows, with the chip's spinner/`long` marks gated on the turn still
streaming. The **Overlay panel, scroll preserved** bullet stays true.
- `docs/chat-verification.md:140` — the "Conversation — tool chip expanding" row
names `ChatToolCalls.kt` and the per-chip panel; it should name the summary chip
and the per-turn popup list, and the pure tests now include the label, count,
announcement and per-row derivations in `ChatFormatTest` (the placement maths in
`ToolPanelPositionProviderTest` is unchanged).