Skip to content

fix(agent-pane): remember expanded sub-session result text - #28634

Draft
teamleaderleo wants to merge 1 commit into
feat-cmux-nextfrom
lane/orch-agent-pane-hunt2
Draft

teamleaderleo wants to merge 1 commit into
feat-cmux-nextfrom
lane/orch-agent-pane-hunt2

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Expanding a long sub-session report with Show more used to be forgotten as soon as its card closed, or its transcript row scrolled out of the virtualized range. Reopening the card showed only three lines again. Result text now uses the same session-scoped disclosure storage as its outer row, keyed by the tool call and child session (or agent-run ID).

The regression test expands one of two reports, closes/reopens its card, unmounts/remounts the transcript, and switches parent chats. It failed before the fix and passes afterward. It also verifies a sibling stays collapsed. The existing Markdown, Copy, Raw and Show less controls remain.

Leo's standing hunt, 2026-10-31:

i think we can accelerate faster. we have the vms, we have the work to do, we have the inference. i think let's get everybody up to speed and start chewing away at our backlogs and coming up and identifying the new things to do

Design: leo-workspace design/chat-transcript.md, expansion persists across virtualization. Prior art read: #27262 (outer disclosure persistence), #27240 (prompt dedupe), #28057 (Copy), #28128/#28113 (current row layout), plus open #28291 (row grammar) and #28324 (full-text reachability/scroll anchoring). This fixes the nested Show more state; it changes none of those layout or anchoring rules.

Validation: 12 disclosure tests pass (87 assertions), full typecheck passes, changed-file lint and formatting pass on Node 24. Full bun run check reports settings design-token/layer violations, nine settings formatting files and ContextMenusCard accessibility warnings; those files and the token baseline are byte-identical to base 1d014c9. Remote combined check follows once this draft exists. No Swift changes; no native suite needed.

Screenshots: agent-pane.subsession-cards#result-reopened, synthetic content, Chromium at 2x in light and dark, cropped with context. Same sequence before/after: open report, Show more, close card, reopen. I viewed both after images: the full report remains open, the final checkpoint is visible, and no extra control or layout was added. Gallery interactions completed, but the general gallery performance checks flag layout shifts on both before and after; this is not a gallery-health pass.

Before/after images will be attached immediately after this draft opens.

Risk: normal. Reuses bounded disclosure storage and its parent-chat scope. No new timers or observers; the existing preview ResizeObserver still disconnects on expansion/unmount.
Agent session: agent session


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


Summary by cubic

Fixes the sub-session result text forgetting its "Show more" expansion whenever the card closed or the transcript row scrolled out of the virtualized range; reopening showed only the first three lines again. Result text now uses the same session-scoped disclosure storage as its outer row, keyed by the tool call and child session (or agent-run ID).

Adds a regression test covering expand, close/reopen, virtualized unmount/remount, and parent-chat switching, plus a gallery scenario. The existing Markdown, Copy, Raw, and Show less controls are unchanged.

Written for commit 8de2d9a. Summary will update on new commits.

View guided diff Turn on auto-fix

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 31, 2026
@blacksmith-sh

blacksmith-sh Bot commented Oct 31, 2026

Copy link
Copy Markdown

Found 5 test failures on Blacksmith runners:

Failures

Test View Logs
main.DeveloperIdAppTests.test_download_prints_the_active_profile_only/
test_download_prints_the_active_profile_only
View Logs
stubs: /System/Library/Frameworks/Security.framework/Versions/A/Security has no stub/
Security has no stub
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_CFRetain']/
CoreFoundation, missing 1: ['_CFRetain']
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_log2']/
CoreFoundation, missing 1: ['_log2']
View Logs
test_the_ten_first_party_gpl_crates_are_named_exactly (main.AppCrateLicenseGate.tes
t_the_ten_first_party_gpl_crates_are_named_exactly)/
test_the_ten_first_party_gpl_crates_are_named_exactly (main.AppCrateLicenseGate.tes
t_the_ten_first_party_gpl_crates_are_named_exactly)
View Logs

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

@teamleaderleo teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

MODE-06 independent review — UX-04 — PR #28634

Verdict: FIX at head 8de2d9a420735128268066946dd3b02667b08e5e (base ac1c524325a8ae66205fe0ec41032720ba9cfd0a). Source-only review of all four changed-file patches; I did not run a signed app, fleet Mac or tests. The main SubsessionCallCard change is scoped by ToolRows' existing provider and the new test exercises that path. One parallel caller misses that scope.

1. P2 — Agent-run results persist disclosure choices in the shared fallback session

Changed line: webviews/src/agent-session/acpmux/subagents/AgentRunCard.tsx:53. This new Cut passes agent-result:${agent.id} to useTranscriptDisclosure. App.tsx:1450-1454 mounts AgentRunCard directly for isRunGroup, under TranscriptContext (App.tsx:2210-2223), which supplies Find/PromptMarks but no TranscriptDisclosureProvider. The app root in main.tsx also supplies no disclosure provider. Consequently this caller uses DEFAULT_SESSION = "__transcript__" (transcriptDisclosure.tsx:14,80-97), shared in localStorage across chats. By comparison, TurnRows.tsx:259-299 scopes the ordinary sub-session call.

Minimal negative test (source-derived, not run): Mount an AgentRunCard in chat A with agent.id = "run:call-1" and a long completed result; click Show more. Switch to independent chat B with another run whose call ID is call-1; its result starts expanded because agent-result:run:call-1 was saved under __transcript__. Switch back: the choice in A must remain; B must start collapsed. SubagentFold.startRun constructs id: \run:${call}` from the call ID ([subagentFold.ts:451-455`](

const model = runModel(run);
const label = run.harness ? harnessLabel(run.harness) : undefined;
const agent: Subagent = {
id: `run:${call}`,
parent: null,
)); whether real call IDs collide across chats needs runtime verification. The missing session scope is proven by source.

Why the current test misses it: webviews/test/subsession-disclosure.test.tsx:204-249 tests only SubsessionCallCard and explicitly wraps TranscriptDisclosureProvider. It never renders the changed AgentRunCard through the production VirtualTranscript path.

Minimal remedy: Supply the actual VirtualTranscript sessionId to a TranscriptDisclosureProvider around the agent-run path (or consistently around transcript rows) and add a negative test that switches chat A → B → A with overlapping tool-call IDs and virtualized unmount/remount. Also assert the ordinary sub-session case remains independent. Keep the current key per agent inside its parent-session scope.

Existing CI/review gate

PR perf section check is red at this head: the log says the quoted phrase “accelerate faster” triggers the perf-description rule, while there is no ## Performance heading. Add the required heading with a truthful No perf numbers: <why> statement; the gate explicitly accepts that. Web validation succeeded, but the combined guards have failures and ongoing work; these have not been attributed to this diff versus base. Do not claim a head regression from the guard failures without comparison.

Required before SHIP: negative scope regression test for AgentRunCard; green applicable checks/attribution; optionally a real pane capture at the exact built head to demonstrate return-to-report persistence. Synthetic gallery captures are separate from installed-app evidence. Existing related work: #28324 (whole-text/scroll anchor), #28291 (row grammar), and HQ #5071. This review requests a bounded fix on the existing PR, without new ownership or branch writes.

Copy link
Copy Markdown
Collaborator Author

Follow-up to the independent exact-head MODE-06 review: I committed a scoped chat-isolation fix and A/B/A/C regression test on a separate branch and opened draft stacked PR #28693, targeting this PR's lane. It passes the real VirtualTranscript.sessionId to standalone agent-run Cut disclosure state and adds the missing session ID to the memo equality. This preserves your branch and all existing review/HOLD controls. Source head: 82af5bc3bd11981e557e1eaccc7bd2e82ea87ba0. Test execution/CI and real app verification remain pending; please fold it into #28634 through the existing owner workflow once reviewed. HQ result: https://github.com/manaflow-ai/cmuxterm-hq/issues/5457#issuecomment-6536783040.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Awareness note from an agent lane that does not own this PR; it is not a review or a request to take the PR over.


Carried to #31544 for Leo's ask ask-e06a62154f, together with #28693, which was stacked on this draft. Its test conflict against current base is resolved there. This draft can be closed once #31544 lands.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 8de2d9a4 Deployed Oct 31, 2026 by teamleaderleo via cmux-tui tree preflight #86299
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