Repository navigation
cmux-next: New Agent Chat opens a new workspace - #18137
Conversation
…y the chat Red: Cmd-I opens a chat tab in the focused pane today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cmd-I, the menu and the palette open a workspace whose only tab is the chat, seeded with the focused tab's cwd and draft, and the window shows it, like a new thread in the Codex and Claude apps. No terminal is made for it. Scripts and an explicit target still get a tab in the pane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chat-new-workspace
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Not verified: macOS jobs did not run: compile and app tests were skipped on CI passes on Written by |
|
Review (correctness read, nx-docked-column lane). Concrete defects:
|
…chat-new-workspace
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
…ersation tabs Since affcfe5 the app refuses new-conversation-tab on a daemon that does not advertise conversation-tabs-v1, and TopologyDaemon advertises only the required capabilities, so the chat was never created and the test's force unwrap crashed the suite. The fixture now advertises it, and a missing chat fails the test through #require instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its seed Cursor review on #18137: the tree can list the chat before new-conversation-tab replies, and a view built then took no seed, so the focused tab's folder and draft never reached the new chat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re the reply openFirstPage held the chat seed only after new-conversation-tab replied. The tree can list the tab first, and a pane showing it built the view with no seed, so the chat lost the focused tab's folder and draft. The seed is now held under the new workspace before the request; a view built meanwhile takes it (tab, pane, workspace in the store), and otherwise it moves to the tab's key on the reply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 164b6f3. Configure here.
| guard !firstChats.isEmpty, let tab = store.tab(id: key), let pane = store.pane(containing: tab.surface), | ||
| let workspace = store.workspace(containing: pane.handle) else { return nil } | ||
| return firstChats.removeValue(forKey: workspace.handle) | ||
| } |
There was a problem hiding this comment.
Chat seed handle collides across daemons
Medium Severity
firstChats is app-global but keyed only by WorkspaceHandle, a per-daemon integer. firstChatSeed then takes that entry from whatever store owns the tab being shown. A first-time agent view on another machine whose workspace id matches can consume the pending seed, so the new chat loses its cwd and draft and another tab can inherit them.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 164b6f3. Configure here.


Summary
New Agent Chat (Cmd-I, the menu, the palette) opens a new workspace whose only tab is the chat, and the window switches to it. This is section D of the 2026-10-06 call ("new agent chat opens in a new workspace unless told otherwise").
It copies the Codex and Claude desktop apps, where a new chat is a new thread with the chat alone on the left. References in manaflow-ai/cmux-app-screenshots:
captures/codex/app-tour-20261003/39-right-panel-changes-diff-view-nosidebar.pngcaptures/claude/desktop-code-20261003/03-browser-panel-open-instantly.pngHow it behaves:
WorkspaceCreation.newTabPage, the path a person's new workspace already uses for the New Tab page, with a chat in place of the page.lastScrollingColumn). The next PR docks it when the first terminal or browser opens to its right.Not added: a setting to turn this off. A Settings row would also need the settings page's locale bundles rebuilt (
build-pages-web.sh, bun), which this lane doesn't run. It can follow if wanted.Testing
AgentChatNewWorkspaceTestswas committed red before the fix. Both runs used./scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext <suites>on a fleet runner.TopologyDaemonnow answersnew-conversation-tabinto a workspace.aPersonsNewAgentChatOpensAWorkspaceWithOnlyTheChatfailed: nocreate-workspacewas sent, so the chat went into the focused pane.aScriptsNewAgentChatStillOpensATabInThePaneandAgentHandlerTestspassed.AgentChatNewWorkspaceTests,AgentHandlerTests,WorkspaceSpawnFirstTabTests,AgentHomeNewChatTests,AgentHomeTests,AgentPaneShortcutsTests,LeaderLayerTests,SurfaceTabBarTests,NewTabKindTestsfeat-cmux-nextwas merged afterwards (b430f1c). It changed none of these files.Live check on a capture mini, fleet build of b430f1c (job 2d9924b6): Cmd-I (a real foreground key event) with a terminal at
~focused opened workspace-3. The window switched to it, its only tab is the chat, and the composer had focus. The chat started in its own agent-home folder, not~, which matches AGENT-CWD-FOR-FOLDERLESS-WORKSPACE. No terminal was created.User-facing strings: none added.
Not run: a review sub-agent (lane rule: no sub-agents).
Review fix (Cursor): a chat whose tab the tree listed before
new-conversation-tabreplied took no seed, so it lost the focused tab's folder and draft.AgentChatNewWorkspaceTests.aChatShownBeforeTheReplyStartsFromItsSeedwas committed first (bd2b917; its red is a build failure, since the seed handoff did not exist) and passes with the fix 9c038cc in hosted swift test. After base affcfe5, the test daemon advertises conversation-tabs-v1, which new-conversation-tab now requires.Proof
Before (terminal focused) and after Cmd-I. Host names are redacted.
Changelog
Changed: in cmux-next, New Agent Chat (Cmd-I) opens a new workspace with the chat instead of a tab in the focused pane.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
New Agent Chat (Cmd-I, the menu, the palette) now opens a new workspace whose only tab is the chat, and the window switches to it, matching the Codex and Claude desktop apps. The chat inherits the focused tab's cwd and draft even when the tree shows the tab before the daemon replies, and no terminal is created for it. CLI/MCP calls, pane-targeted calls and daemons that can't hold a chat still open a tab in the pane; no setting to turn this off was added.
In this lane
agents.chats.*managed roots settings.build-web-bundles.shin every build path; the cmux-tui tree publishes Linux daemon binaries.Written for commit 164b6f3. Summary will update on new commits.
Note
Medium Risk
Changes default workspace creation and tab seeding for a core user shortcut; race handling around daemon/tree timing adds complexity, though scripts and targeted invocations are gated off the new path.
Overview
New Agent Chat (Cmd-I, menu, palette) for a person now creates a new workspace whose only tab is the chat—the window switches to it—and no terminal is spawned. The chat still inherits the focused tab’s cwd and draft via
WorkspaceSpawn.firstChatand the existing workspace “first tab” path (WorkspaceCreation.newTabPage/openFirstPage(..., chat:)).Automation and legacy behavior are unchanged: CLI/MCP, an explicit pane target, or a daemon that can’t host chats still open a tab in the focused pane (
openNewAgentChat).Seeding race:
AgentTabStoreholds a per-workspace chat seed (firstChats/seedFirstChat/firstChatSeed) so if the tree lists the tab beforenew-conversation-tabreplies, the pane view still gets the seed.AgentPaneSeedSource.take()is now public for tests.Tests:
AgentChatNewWorkspaceTestsandTopologyDaemonhandling for workspace-scopednew-conversation-tab.Reviewed by Cursor Bugbot for commit 164b6f3. Bugbot is set up for automated code reviews on this repo. Configure here.