cmux-next: a subagent pane draws its chat from the kept tail
Leo: "i also like the way it just loads in the subagent stuff instantly :(" / "as in i want ours to load fast too :("
What
Clicking a subagent opens it in a pane of its own (chat.subagentPane). That pane is a new tab on the chat's own session (subagentPanes.ts). openOwnTab and onMoveToTab hand the chat on screen to the host before chat.openTab, so the new tab draws it from the kept tail (tailCache.ts) before its attach answers. showSubagent never did this. The subagent pane found nothing kept, opened blank and waited for its own attach round trip.
This PR adds the same one-line hand-over before openSubagentPane. It also adds a source-reading wiring test, next to the existing chat.openTab one, so the call can't be dropped silently.
Tests
bun test test/agent-pane-new-tab-cached-chat.test.ts: 13 pass. With the App.tsx change reverted, the new test fails (12 pass, 1 fail).tsc --noEmit: the only error istest/latency/probe.tsinteractionId, which is unchanged from base.
Performance
| metric | before | after | delta | harness |
|---|---|---|---|---|
| subagent pane: host kept tail present at open | no (cold attach) | yes (drawn from cache) | the attach round trip is no longer on the first paint | red/green test above |
| subagent click to first content (fleet) | pending | pending | pending | chat-open bench (cmux#27625, lands first), subagent case |
The fleet numbers will be added when the bench lands on feat-cmux-next, since the controller runs measure scripts only from there.
Risk
Low. The change is one call that the two tab-open actions already make. It sends the chat's current tail to the host's in-memory cache and changes nothing else.
🤖 Generated with Claude Code
Agent session: agent session
![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.