Agent pane: a sub-session or agent-run result keeps its "Show more" after the card closes, scrolls away or the chat switches
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
Cutreads and writes its open state through the existing transcript disclosure storage (useTranscriptDisclosureinconversation/transcriptDisclosure.tsx), the same storage the card's own disclosure uses.disclosureKeyis now a required prop.- Every
Cutcall 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>
- sub-session reply:
- Standalone agent-run rows (
SubagentGroupRowinApp.tsx) renderAgentRunTranscriptCard, which wraps the card inTranscriptDisclosureProviderwith 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 comparessessionIdso a chat switch re-renders the row. - Gallery: the
result-reopenedvariant onSubsessionCallCardexpands 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](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
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.
Cutnow stores its open state through the existing transcript disclosure storage instead of local state, with a required stabledisclosureKeyper 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.