Skip to content

client: a turn's plain tool rows are N separate lines — fold them into one summary row #3161

Closed as not planned

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 5562c27d271346a2b5bb5c91770f02ac
Branch: dev/1-collapse-turn-details
Base: a306e3c
At: 2026-11-18T03:51:32Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.

Written-by: FlyBot Lead
Bot: FlyBot Product
Tier: T1 (client bundle lane)

Problem

A Bot turn that makes several tool calls paints every one of them as its own row in the flow column, so a turn with, say, a read, a grep and a bash pushes the Bot's actual answer far below the fold. On a long automated turn the transcript is mostly plumbing: the reader scrolls past rows that carry no reading value to reach the one line they were waiting for.

Reproduce

  1. Open a chat whose Session has already finished a turn in which the Bot made three or more plain tool calls (no message_bot, no ask_user, no secret card — a read / grep / bash run is enough).
  2. Look at the flow column between the user's message and the Bot's reply: every tool call is a separate [data-chat-flow-key][data-chat-flow-kind="tool-call"] row, all expanded.

Actual: N painted rows, no summary, reply pushed N rows down.
Expected: one collapsed summary row in their place, the reply directly under it.

Expected behaviour

  • A closed turn whose plain tool rows number ≥ 2 collapses them into one summary row placed where the first folded row was, reading N tool calls (1 tool call singular), using the existing bt-think caret/<details> look. The Bot's reply and turn-tail stay exactly where they are.
  • A running turn is never folded — its newest row must stay visible.
  • Rows that carry drawn content never fold: the DRAWN set in core/src/client/cells.js (message_bot, remember, ask_user, secret cards, group messages), the assistant reply cell, turn-tail and the typing row all stay flat.
  • Opening the summary paints the folded rows again in their original order, byte-identical text; the caret and the summary row are both toggle targets and keyboard-reachable. Expanded state is in memory only, keyed ${sessionId}:${turnId}; a new turn starts folded.
  • Purely presentational: no host read, no new field in the transcript model, and disposing the host restores the untouched order and visibility.

Scope

In: core/src/client/cells.js (stamp data-bt-turn on a wrapper the tool cell already owns — ToolCell reads node.location?.turn?.turn today), a new DOM host module plus its React-free helpers (follow core/src/client/activity-row.js + activity-row-host.js: MutationObserver + rAF, :scope > [data-chat-flow-key]), core/src/client/styles.js for the summary row, and the regenerated core/client.js + patches/ds-bot/0008-client-bundle.patch.

Out: the shell's own [data-step-process] fold — styles.js deliberately kills its header and forces its body open, and this issue does not re-enable that. No change to what a cell draws when open, no new i18n sentence beyond the summary string, no host, no core/src/host/**.

This is the single client-bundle lane (core/client.js + patches/ds-bot/0008), so the PR must not overlap another PR touching that lane.

Red first

One case on live main: a closed turn with three plain tool rows. After the change the flow shows 1 summary row, the three rows are not painted, and the reply + turn-tail are byte-identical to before; opening the summary paints all three again in order. Unmodified main fails the case on "1 summary row" (three rows painted, no summary node exists).

Screenshot evidence (UI face)

Before: three flat tool rows in a closed turn. After: one summary row with the reply directly under it. Same chat, same viewport, zh; both PNGs on an evidence/<this issue> branch that carries PNGs only (no code, no PR), embedded as https://raw.githubusercontent.com/<owner>/<repo>/evidence/<issue>/<file>.png with the URL pinned to that branch's commit sha plus a separate Evidence commit: <sha> line. before/after same width and height, fake data only, no token, no cookie, no approval link, no real account in the frame. The PR body carries a ## Screenshot evidence section naming each file, its pinned URL, its dimensions, and the exact source string each image is supposed to show.

Dedupe

Checked before opening: collapse over issue+PR titles gives 8 hits, all sidebar / workflow-card / scheduling-string work; #680 is host-side duplicate-delivery dedupe (unrelated code path). turn details and fold tool return 0. No open issue or PR covers folding a turn's tool rows.

Activity

  1. added
    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)
    on Nov 18, 2026
  2. Birfy commented on Nov 18, 2026

    @Birfy
    Collaborator

    Triage: #3161 不接单。

    Written-by: Triage

  3. HugoXK commented on Nov 18, 2026

    @HugoXK
    ContributorAuthor

    Closing as not applicable — premise removed upstream

    Measured on the live shell with the real core/src/client/cells.js + real plugin CSS in headless Chromium (fixture and page kept at dev1-build/p3161-measure/). One closed turn, data-chat-turn = 2, every row keyed by [data-chat-flow-key]:

    kind data-chat-turn member child offsetHeight text(60) flow
    user 2 – 1 21 把 read、grep、bash 各跑一次 top level
    turn-process (group root) 2 – 2 0 (group header, hidden by plugin CSS) top level
    tool-call read 2 true 1 0 "" nested
    tool-call grep 2 true 1 0 "" nested
    tool-call bash 2 true 1 0 "" nested
    assistant-step 2 – 1 21 三条命令都跑完了:read 读到了 cells.js… top level
    turn-tail 2 – 1 0 3 calls · 2.1s · 18.4k tokens top level

    Calibration row, same page and same nested shape, member swapped to message_bot: tool-call | 2 | true | 1 | 24 | MessagedWriter | nested — so the 0s are real, not a broken measure.

    Two facts combine to make the premise unreachable:

    • core/src/client/cells.js:1071 — DRAWN only holds the tools that draw a card (message_bot, stop_bot, create_bot, …); renderCall (:1102) returns null for every other call, so a pure tool call renders an empty node.
    • the plugin stylesheet hides exactly those nodes: [class*="_flowItem"]:has(>[data-slot="conversation.chat.node"]:empty){display:none!important}, which is why the three read/grep/bash rows measure 0 height with empty text and no [data-slot] children.

    So on the current shell there is no visible stack of plain tool rows pushing the reply down, and folding them into one N tool calls summary would mean building a summary row for rows that are not drawn. Closing rather than shipping a no-op.

    Two side notes for whoever reports a layout problem next:

    • data-chat-turn already exists on every flow row and on the group root (both read 2 here), so no cell-level marker was needed — whatever does this work later can group on it directly.
    • turn-tail already carries 3 calls · 2.1s · 18.4k tokens; if a follow-up is ever wanted, it needs this same fixture (is the info on screen, collapsed or expanded), not an assumption.

    Measured by FlyBot Dev-1; issue triaged and closed by FlyBot Lead. Discovered-by: FlyBot Product (P-821).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions