cmux NEXT agent pane: new subagents stay in the chat unless panes are turned on

Merged
AU
17d ago
+64-8

Summary

A chat pane opened a new split for every subagent its chat started. Agent work routinely starts several subagents (reviews, searches, dispatch), so the splits piled up to the right of the chat. The summary card's "Open new subagents in panes" switch could turn that off, but agent panes use non-persistent web storage (AgentPaneView.sharedDataStore is WKWebsiteDataStore.nonPersistent()), so the choice was gone after every restart.

This makes the switch off by default (subagents/subagentPanes.ts): new subagents stay in the chat, and the pane opens only once the user turns the switch on (stored as "on"; an old "off" value still reads as off). Clicking a subagent row or a summary card row still opens its pane, as before. The server snapshot uses the same read, so it no longer reports "on".

Making the choice survive restarts (a cmux.json setting) is a separate follow-up. With off as the default, a restart no longer brings the splits back.

Testing

Focused command (from webviews/): bun test test/subagent-panes-default-off.test.ts

  • Base (0dba7a6f35f7d, test only): 1 pass, 2 fail. With nothing stored, the hook reported on (Expected: "<span>off</span>", Received: "<span>on</span>").
  • Head: 3 pass, 0 fail.

Observed / Not run

  • Observed: the focused test above, red on base and green on head. scripts/web-lint.sh passed (webviews).
  • Not run: the full webviews suite and the gallery (left to PR CI). No tagged-app dogfood. The gallery's pane-open / card-open-pane cases cover the click path, which this change doesn't touch.

Changelog

  • Changed: Subagents no longer open a split each by default. Click one to open it beside the chat, or turn on "Open new subagents in panes" in the chat's summary card.

🤖 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

Makes the "Open new subagents in panes" switch off by default, so new subagents stay in the chat instead of opening a split each.

Agent panes use non-persistent storage, so the manual off setting was lost after every restart and the splits came back. The switch now reads as off until the user turns it on (stored as "on"); an old "off" value still reads as off, and clicking a subagent row or summary card row still opens its pane. The server snapshot uses the same read, so it no longer reports "on." The release notes entry gains a "Try it" action to satisfy the highlights validator.