Skip to content

Agent chat: a long tool output that wraps past eight rows collapses with Show more - #24463

Closed
teamleaderleo wants to merge 2 commits into
feat-cmux-nextfrom
tp-tool-output-showmore
Closed

teamleaderleo wants to merge 2 commits into
feat-cmux-nextfrom
tp-tool-output-showmore

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Leo's words (2026-10-22 21:28Z): "also the tool calling i think there should be more of like a "show more" type thing for long outputs or whatnot..."

Leo-ask: ask-c57e055a4e

What base already does

#23413 (merged 2026-10-21 15:59Z, after the 03960f5 nightly Leo's app runs) already collapses a tool block longer than eight lines:

  • its first eight lines show under a 28px bottom fade;
  • "Show all N lines" opens it in place, and "Show less" closes it;
  • the button is keyboard reachable, and Find in Chat opens the block.

That covers a call's output, a command's Shell block and an edit's diff.

The gap this fixes

The cap counted newlines only. Output wraps by default, so a result with a few long lines (a one-line JSON result, a minified log line) wrapped to dozens of rows with no cap and no toggle.

Change

Before / after (synthetic gallery fixtures, agent-pane.tool-output-collapse, Linux Chromium)

Before (base 4c3b775) After, collapsed After, Show more clicked
before after collapsed after expanded

Light: after light. The line-cut case is unchanged: lines

Live before/after: scripts/gallery-compare.sh → /compare/tp-tool-output-showmore/ on the gallery host (tailnet).

Versions tried (gallery experiment tool-output-collapse, Compare arms)

fade-link (shipped): 8 rows, bottom fade, text link six-bar: 6 rows, fade, full-width quiet bar ten-chip: 10 rows, hard cut, corner chip fifteen-link: 15 rows, fade, link
fade-link six-bar ten-chip fifteen-link

I picked fade-link because it is closest to Claude Code and the Codex app, which show a few lines and then a quiet "Show more" under the block. It is also the look #23413's line-cut blocks and #23431's long prompts already use, so the transcript keeps one collapse.

  • The chip covers the last visible line.
  • The bar is heavier than the row it serves.
  • Fifteen rows is a tall preview in a narrow pane.

The other arms stay in the gallery for comparison. Nothing changes for anyone by default beyond the wrapped-rows cut.

Performance

  • The collapse itself is CSS (the existing [data-preview="cut"] max-height, now var(--cv-preview-rows, 8)).
  • Rows are read only for a block that is drawn (an opened call), whose output has 8 or fewer lines, wraps, and has a line of 24 or more characters. A read is one scrollHeight plus one computed style, in a layout effect, when that block's own text, wrap or line count changes. No per-frame loop, and nothing per token for any other row.
  • Observer: one ResizeObserver on that block's own body, so a narrower or wider chat re-reads it. Stop condition and cleanup: it is disconnected when the block's text changes, when it stops wrapping or fits by line count, and when it unmounts.
  • No hot path changed for closed rows, so there is no before/after number.

Find

The text is drawn whole and only clipped, so Find counts it. A Find reveal bumps reveal, which opens the block, as for line-cut blocks (tested).

Tests

webviews/test/transcript-wrapped-output-preview.test.tsx covers:

  • cut with Show more, then Show less, with the control a real button that Find skips;
  • no toggle at 8 rows or fewer;
  • narrowing and widening re-read the block;
  • Wrap lines off is not cut;
  • the Shell block;
  • a Find reveal opens the block;
  • a whole block is never cut;
  • the experiment arm sets the rows;
  • the shipped arm still cuts at 8.

Observed / Not run

  • Ran on huge-blue at f3474b1:
    • the new file plus transcript-block-overflow, transcript-output-copy, permission-edit-diff, agent-pane-edited-card-expand and the shell tests: 57 pass, 0 fail;
    • gallery agent-pane-entries, manifest, play and play-names tests: pass;
    • vp fmt --check and vp lint on the changed files: clean;
    • type check: no errors in changed files;
    • acpmux-protocol check: pass.
  • Base findings, not from this PR:
  • Not run: no Swift change, so no app compile is needed.

Changelog

Fixed: A long tool output whose lines wrap past eight rows now collapses with Show more in agent chats.

Agent session: cosmic-gray

🤖 Generated with Claude Code

…ses with Show more

A tool block already showed its first eight lines under a fade with Show all N
lines (#23413), but it counted newlines only: a one-line JSON result or a
minified log line wrapped to dozens of rows with no cap and no toggle. Those
are now cut at eight rows too, with Show more, and Show less closes them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16030-bf28-7072-b1f6-b83bbd0beacc&host=cosmic-gray
@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review f3474b1: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr24463 -f ref=tp-tool-output-showmore -f platform=macos -f backend_mode=local

Probably yours: accent-glass-invariants.test.ts fails here but not on main's latest full suite. Seen on other PRs too (likely flaky): agent-pane-adopted-tool-calls.test.ts, composer-type-scale.test.ts, composer-type-scale.test.ts and 4 more.

CI failed on f3474b1a74 (run 39903556961 attempt 1): 1 code, 1 unknown.

Job Verdict Why
web / react-apps-check (1) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • new in this PR accent-glass-invariants.test.ts no orange or system accent and no opaque glass on 1845 gallery stages: failed (job)
  • seen on other PRs agent-pane-adopted-tool-calls.test.ts the adopted turn's Worked for opens to its commands and edited files: failed (job)
  • seen on other PRs composer-type-scale.test.ts agent-pane.composer new-chat draws its text on the type scale: failed (job)
  • seen on other PRs composer-type-scale.test.ts agent-pane.composer footer-essentials draws its text on the type scale: failed (job)
  • seen on other PRs composer-type-scale.test.ts agent-pane.composer footer-full-access draws its text on the type scale: failed (job)
  • seen on other PRs composer-type-scale.test.ts agent-pane.composer footer-essentials-new-chat draws its text on the type scale: failed (job)
  • seen on other PRs composer-type-scale.test.ts agent-pane.composer agent-home draws its text on the type scale: failed (job)
  • seen on other PRs composer-type-scale.test.ts agent-pane.composer agent-home-path draws its text on the type scale: failed (job)
Matched log lines
web / react-apps-check (1): (fail) no orange or system accent and no opaque glass on 1845 gallery stages [337761.25ms]

Not re-run automatically: web / react-apps-check (1), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: red check: Checks job structure (+2 more) is not red on the base 740e58f; do not merge until green; see lane-rules
red: web / Web status; no finished base run on 740e58f to compare; do not merge until green; see lane-rules
red: web / react-apps-check; no finished base run on 740e58f to compare; do not merge until green; see lane-rules
red: web / react-apps-check (1); no finished base run on 740e58f to compare; do not merge until green; see lane-rules

Gallery before/after for f3474b1: 16 states rendered, 1 images differ, 1643 more touched states not rendered. Images are in the run's artifact, not on this public PR.

gh run download 39903557002 -R manaflow-ai/cmux -n gallery-advisory-24463-f3474b1a74657b2ea1418e2439323579906cf0ce (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.chat-find-bar/empty Apple System Colors Light unchanged 0% own conversation.css
agent-pane.chat-find-bar/empty Apple System Colors unchanged 0% own conversation.css
agent-pane.chat-find-bar/matches Apple System Colors Light unchanged 0% own conversation.css
agent-pane.chat-find-bar/matches Apple System Colors unchanged 0% own conversation.css
agent-pane.chat-find-bar/next-match Apple System Colors Light unchanged 0% own conversation.css
agent-pane.chat-find-bar/next-match Apple System Colors unchanged 0% own conversation.css
agent-pane.chat-find-bar/no-results Apple System Colors Light unchanged 0% own conversation.css
agent-pane.chat-find-bar/no-results Apple System Colors unchanged 0% own conversation.css
agent-pane.diff-panel/last-turn Apple System Colors Light unchanged 0% own conversation.css
agent-pane.diff-panel/last-turn Apple System Colors unchanged 0% own conversation.css
agent-pane.diff-panel/toolbar Apple System Colors Light unchanged 0% own conversation.css
agent-pane.diff-panel/toolbar Apple System Colors unchanged 0% own conversation.css
agent-pane.diff-panel/tree-selection Apple System Colors Light unchanged 0% own conversation.css
agent-pane.diff-panel/tree-selection Apple System Colors unchanged 0% own conversation.css
agent-pane.diff-panel/open-file-error Apple System Colors Light unchanged 0% own conversation.css
agent-pane.diff-panel/open-file-error Apple System Colors unchanged 0% own conversation.css
agent-pane.diff-panel/escape Apple System Colors Light unchanged 0% own conversation.css
agent-pane.diff-panel/escape Apple System Colors unchanged 0% own conversation.css
agent-pane.diff-panel/review-file Apple System Colors changed 0% own conversation.css
agent-pane.diff-panel/review-file Apple System Colors Light unchanged 0% own conversation.css
agent-pane.diff-panel/stage-hunk Apple System Colors Light unchanged 0% own conversation.css
agent-pane.diff-panel/stage-hunk Apple System Colors unchanged 0% own conversation.css
agent-pane.diff-panel/more-lines Apple System Colors Light unchanged 0% own conversation.css
agent-pane.diff-panel/more-lines Apple System Colors unchanged 0% own conversation.css
agent-pane.path-chip/file Apple System Colors Light unchanged 0% own conversation.css
agent-pane.path-chip/file Apple System Colors unchanged 0% own conversation.css
agent-pane.path-chip/folder Apple System Colors Light unchanged 0% own conversation.css
agent-pane.path-chip/folder Apple System Colors unchanged 0% own conversation.css
agent-pane.path-chip/outside-lock Apple System Colors Light unchanged 0% own conversation.css
agent-pane.path-chip/outside-lock Apple System Colors unchanged 0% own conversation.css
agent-pane.path-chip/outside-text Apple System Colors Light unchanged 0% own conversation.css
agent-pane.path-chip/outside-text Apple System Colors unchanged 0% own conversation.css

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by transcript-parity on cosmic-gray · session

@teamleaderleo

teamleaderleo commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by nx-chat on big-red · took over from session 01a16030

@blacksmith-sh

blacksmith-sh Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Found 25 test failures on Blacksmith runners:

Failures

Test View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
/tmp/tmp4dxkl_4l/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmp_z8bb0df/summary-fail.json (live):/summary-fail.json (live): View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs

...and 15 more test failures. View all on Blacksmith: run 39903556961, run 39903556998, run 39903556878

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next guards / nightly-guards / workflow-guard-tests / release-notary is red on 12 of 17 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Checks job structure is red on 9 of 11 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › No new SwiftUI (macOS UI is AppKit) is red on 9 of 11 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-rkgqg created for this PR by the cmux coordinator.

Four looks for a long tool output's collapse (8 rows + fade + link, the
shipped one; 6 + fade + bar; 10 + hard cut + chip; 15 + fade + link),
compared in the new agent-pane.tool-output-collapse gallery entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16030-bf28-7072-b1f6-b83bbd0beacc&host=cosmic-gray
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Script tests (pin-cmux-tui, embed-cef, ensure-cef store) is red on 8 of 13 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Orphaned: no activity for 69 h, and no lane holds a lease on it. The orphan sweep could not merge feat-cmux-next in: conflicts in webviews/src/agent-session/acpmux/conversation/ShellBlock.tsx, webviews/src/agent-session/acpmux/conversation/ToolRow.tsx, webviews/src/agent-session/acpmux/conversation/conversation.css, webviews/src/experiments/registry.ts. Listed for a lane to resolve.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Stale (13d, conflicts); rebuild fresh from feat-cmux-next if still wanted

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Stale (13d, conflicts); rebuild fresh from feat-cmux-next if still wanted. Added to nx-chat stale backlog.

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

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant