Skip to content

Agent pane: a sub-session or agent-run result keeps its "Show more" after the card closes, scrolls away or the chat switches - #31544

Merged
teamleaderleo merged 8 commits into
feat-cmux-nextfrom
lane/ask-e06a-subsession-showmore-persist
Nov 2, 2026
Merged

teamleaderleo merged 8 commits into
feat-cmux-nextfrom
lane/ask-e06a-subsession-showmore-persist

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Carries draft #28693 (opened by ChatGPT for Leo, tests not run there) together with the draft it was stacked on, #28634 (an earlier agent-lane draft). Both are carried here as one PR.

Leo: "oh btw i talked with chatgpt and they raised a bunch more drafts and issues across cmuxterm-hq, cmux, and cmux-platform. some stuff worth looking at"

What was wrong

On base, the result text in a sub-session card (wait_for_sessions reply) and in a standalone agent-run card is shown through Cut in SubsessionCallCard.tsx, and Cut kept its "Show more" state in a plain useState. When a reader expanded a long report, closing the card, scrolling it out of the virtualized transcript or switching chats and back collapsed it again.

What changed

  • Cut reads and writes its open state through the existing transcript disclosure storage (useTranscriptDisclosure in conversation/transcriptDisclosure.tsx), the same storage the card's own disclosure uses. disclosureKey is now a required prop.
  • Every Cut call site on current base supplies a stable key. There are two, and no prompt cuts remain on base:
    • sub-session reply: subsession-reply:<tool id>:<sub-session id>
    • agent-run result: agent-result:<agent id>
  • Standalone agent-run rows (SubagentGroupRow in App.tsx) render AgentRunTranscriptCard, which wraps the card in TranscriptDisclosureProvider with the row's chat id. That way a tool-call id that repeats in another chat does not share the choice. It follows the existing per-row provider pattern (WorkingRow); no outer provider surrounds these rows, so nothing is wrapped twice. The row memo now compares sessionId so a chat switch re-renders the row.
  • Gallery: the result-reopened variant on SubsessionCallCard expands a result, closes the card, reopens it and checks that "Show more" is still expanded.
  • Tests (webviews/test/subsession-disclosure.test.tsx):
    • the choice survives closing the card and a virtualized remount, and does not carry into a different parent chat
    • an agent run's choice is scoped to its parent chat across switches and remounts

Carry notes: the cherry-pick conflicted in the test file, because base has since replaced the "started labels" test with "a started sub-session's row is its name". The conflict was resolved by keeping base's test and adding the new tests in front of it. No other changes vs the drafts.

Risk

Small and contained to the agent pane's result cards. Choices are stored per view (Normal / Thinking / Verbose), like every other transcript disclosure. A chat-find reveal that opens a cut is now remembered as well.

Leo-ask: ask-e06a62154f
Agent session: agent session
🤖 Generated with Claude Code


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


Summary by cubic

Persists the "Show more" state on sub-session and agent-run result cards so expanding a long report stays expanded after closing the card, scrolling it out of the virtualized transcript, or switching chats and back.

  • Cut now stores its open state through the existing transcript disclosure storage instead of local state, with a required stable disclosureKey per result.
  • Agent-run disclosures are scoped to their parent chat, so a repeating tool-call id in another chat doesn't share the choice.
  • Adds gallery and unit coverage for reopening cards and switching chats.

Written for commit 247b29d. Summary will update on new commits.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 28020db: 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=pr31544 -f ref=lane/ask-e06a-subsession-showmore-persist -f platform=macos -f backend_mode=local

Gallery before/after for 247b29d: 16 states rendered, 2 images differ, 1785 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41389957717 -R manaflow-ai/cmux -n gallery-advisory-31544-247b29d27cffcaf57f5875f9c7ad2d9986ff066a (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.agent-runs/card-running Apple System Colors Light changed 0.0324% own AgentRunCard.tsx
agent-pane.agent-runs/card-running Apple System Colors changed 0.0142% own AgentRunCard.tsx
agent-pane.agent-runs/card-done Apple System Colors Light unchanged 0% own AgentRunCard.tsx
agent-pane.agent-runs/card-done Apple System Colors unchanged 0% own AgentRunCard.tsx
agent-pane.agent-runs/card-failed Apple System Colors Light unchanged 0% own AgentRunCard.tsx
agent-pane.agent-runs/card-failed Apple System Colors unchanged 0% own AgentRunCard.tsx
agent-pane.card-copy/prompt-rest Apple System Colors Light unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/prompt-rest Apple System Colors unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/prompt-hover Apple System Colors Light unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/prompt-hover Apple System Colors unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/prompt-copied Apple System Colors Light unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/prompt-copied Apple System Colors unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/message-rest Apple System Colors Light unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/message-rest Apple System Colors unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/message-hover Apple System Colors Light unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/message-hover Apple System Colors unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/message-copied Apple System Colors Light unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/message-copied Apple System Colors unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/quiet-rest Apple System Colors Light unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/quiet-rest Apple System Colors unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/quiet-copied Apple System Colors Light unchanged 0% own SubsessionCallCard.tsx
agent-pane.card-copy/quiet-copied Apple System Colors unchanged 0% own SubsessionCallCard.tsx
agent-pane.chat-width/standard Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/standard Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/short-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/short-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/wide-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/wide-edge Apple System Colors unchanged 0% own App.tsx

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

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on d6858a5 to compare; do not merge until green; see lane-rules

Shipped in:

@blacksmith-sh

blacksmith-sh Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Found 8 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmplt3i230u/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpq3_3wieg/summary-fail.json (live):/summary-fail.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames 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
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)/
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)
View Logs
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)/
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)
View Logs

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at 28020db

SHIP at 28020db

Visual verdict: no introduced visual regression across all 16 supplied before/after pairs; differences are animation timing.

No correctness findings. Checked disclosure keys, provider scope, remounts, and chat-switch wiring; tests could not run because Bun is unavailable.

Follow-ups: none

cmux-bot[bot]
cmux-bot Bot previously approved these changes Nov 2, 2026

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 28020db: an independent review passed this exact head (next-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 2, 2026 02:40 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 2, 2026 02:42 Inactive
@cmux-bot
cmux-bot Bot dismissed their stale review November 2, 2026 02:44

A newer verdict blocks aa26255 (no independent SHIP at the head).

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high, sweep, via the review router; full diff from merge base 1941bca to this head): SHIP at 28020db

No P1/P2 findings.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (next-review patch-id; carried): SHIP at aa26255

The independent SHIP at 28020db carries to this head: the PR's own change (git diff $(git merge-base feat-cmux-next HEAD) HEAD) has the same git patch-id --verbatim (3731673a86c7479e) at both heads, and no merge between them was resolved by hand. Nothing new to review. A newer BLOCK, or any change to the PR's own diff, ends the carry.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 2, 2026 04:42 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 2, 2026 04:47 Inactive
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (next-review patch-id; carried): SHIP at 247b29d

The independent SHIP at 28020db carries to this head: the PR's own change (git diff $(git merge-base feat-cmux-next HEAD) HEAD) has the same git patch-id --verbatim (3731673a86c7479e) at both heads, and no merge between them was resolved by hand. Nothing new to review. A newer BLOCK, or any change to the PR's own diff, ends the carry.

@teamleaderleo
teamleaderleo merged commit 9140f5b into feat-cmux-next Nov 2, 2026
179 of 194 checks passed
@teamleaderleo
teamleaderleo deleted the lane/ask-e06a-subsession-showmore-persist branch November 2, 2026 05:40

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 247b29d2 Deployed Nov 2, 2026 by cmux-bot[bot] via wait for same-key tree publisher #99286
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