Repository navigation
cmux NEXT: a new chat's text left when its tab opens another chat comes back in the window's next New Tab page - #32298
Conversation
…r the window's next new chat (red, cmux#32276) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
…es back in the window's next New Tab page A new chat whose tab opens another chat (the sidebar's pick, chat.select or chat.adopt) hands its kept, held and typed text to the host (chat.leftover) before the switch, and its held prompts leave the hold, so none is sent after. The host keeps it in the window's one slot beside the tabs' drafts on disk (a second leftover adds to the first), and the window's next New Tab page takes it once as its field's draft (newTab.draft). Fixes #32276. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Gallery before/after for
States
Pick other states with a Passes: CI passes on CI passes on Written by web and size checks: green Default changesThis pull request changes 2 defaults at
The newest verdict on this commit is a BLOCK from Merge receipt: merged as Regenerate the snapshot with Shipped in:
|
|
Review (codex gpt-6-astra high, router-review): BLOCK at ee5b663 BLOCK at ee5b663
Follow-ups:
|
…a later pick still persists last Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
|
Review (codex gpt-6.1-sol xhigh, router-review): BLOCK at 2e04ed7 BLOCK at 2e04ed7 Visual verdict: no images; Leo tries the build
|
…hows it A page that never shows (its tab failed to open) leaves the leftover for the next New Tab page; a page reports it showed it (chat.leftoverTaken), and a page the host gave none reads its window's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
… every New Tab page Review at 2e04ed7 (router, gpt-6.1-sol): the slot was emptied before the tab opened, so an open that failed later lost it, and only Cmd-T pages got it. Now a page's context carries the window's leftover wherever it is made (Cmd-T, a split, a workspace's first page, a restored one, via newTabForPage), and the slot gives up only what a page reports it showed (chat.leftoverTaken). AgentPaneNewTab.draft is optional, so it defaults to nil. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
|
Review (codex gpt-6.1-sol high, sweep, via the review router; full diff from merge base 0384bf2 to this head): BLOCK at cc74fa3 [P2] [blocking] Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentUnsentDrafts.swift:109 - |
|
Review (codex gpt-6-astra high, router-review): BLOCK at cc74fa3 BLOCK at cc74fa3 Visual verdict: no images; Leo tries the build
|
…t shows; the slot is the page's window's Review at cc74fa3 (router, gpt-6-astra): - A leftover shown on a New Tab page, then a pick from the page with no edit, sent no chat.leftover and was lost. The page keeps the field's text while it holds a leftover (as edited, both templates) and a pick leaves it again; a query typed to find a chat is not left. - chat.leftoverTaken searched every window's slot. It now gives up only the page's own window's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Review (codex gpt-6-astra high, sweep, via the review router; full diff from merge base 0384bf2 to this head): BLOCK at b719142 [P2] [blocking] Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentUnsentDrafts.swift:102 - Appending multiple leftovers can exceed |
|
Review (codex, router-review): SHIP at b719142 Reviewer: codex gpt-6-astra high, fast tier. Follow-ups: 2. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward. SHIP at b719142 Visual verdict: unchanged in all available before/after pairs.
Follow-ups:
|
…until it lands Review at 94f283e (router, gpt-6.1-sol): while chat.select awaited the picked chat, an answered trust question could send a new chat's held prompt into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
…ands Review at 94f283e (router, gpt-6.1-sol): chat.select / chat.adopt awaited the picked chat before taking the new chat's held prompts, so a trust answer in between could send one into the picked chat, and the leftover could repeat it. The pick now pauses new-chat sends synchronously (pauseNewChat), takes the held prompts once it lands (one whose start it cancelled included) and builds the leftover from what it took; a failed or superseded pick only resumes. trust-held-prompts.test.tsx: 17 pass / 2 fail without this, 19 pass with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
|
Review (codex gpt-6-astra high, router-review): BLOCK at dffb7d9 BLOCK at dffb7d9 Visual verdict: no images; Leo tries the build.
Follow-ups: [P2][follow-up] No after screenshots were supplied for this UI change. |
…ttles takes that prompt too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
|
Review (codex gpt-6-astra high, sweep, via the review router; full diff from merge base 0384bf2 to this head): BLOCK at 94f283e2e8ff1a5e03f146e0ada30153b9e7accd [P1] [blocking] |
Review at dffb7d9 (router, gpt-6-astra): a start the pick cancelled could settle after the pick landed; takeNewChat took only the held ones, so the going prompt missed the leftover and came back held for a chat no longer shown. takeNewChat now takes it as release does (marked released: its late settle puts nothing back). trust-held-prompts.test.tsx: 19 pass / 1 fail without this, 20 pass with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-786825ad708e439b96f4
|
Review (codex, router-review): SHIP at 079dc7f Reviewer: codex gpt-6-astra high, fast tier. Follow-ups: 2. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward. SHIP at 079dc7f Visual verdict: retained before/after gallery pairs are byte-identical; the leftover-draft state is not shown.
Follow-ups:
|
|
Review (codex gpt-6.1-sol high, sweep, via the review router; full diff from merge base 0384bf2 to this head): BLOCK at 079dc7f [P2] [blocking] files/webviews/src/agent-session/acpmux/trustHeld.ts:327 - |
A newer verdict blocks 079dc7f (a wait as new as the SHIP or newer: comment by teamleaderleo: Review (codex gpt-6.1-sol high, sweep, via the review rout).
…dingTab:) (tip arch red from ae802cf) (#32521) ae802cf (#32298) added 12 CmuxNextApp lines for a new chat's leftover (cmux#32276), which put the app_lines row over the last green arch tip. The tab -> pane -> workspace chain it added (and four copies of it already in the App) is now one DaemonStore method, workspace(holdingTab:), and the leftover's docs move to AgentUnsentDrafts in CmuxNextAgentPane. Behavior is the same: the method runs the same three store lookups. WorkspaceHoldingTabTests covers the new method (a tab's workspace, a moved tab's new one, an unknown tab). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ative-tools-d Resolve AgentPageProvider.swift: keep base chat.leftover/chat.leftoverTaken (#32298) and this PR's pane.tabRowTools.openMenu in the request-method list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-159afad10a5ab45ea16c
|
Swift logic follow-up (tip watcher swift-logic row, STATUS 13027 "SWIFT LOGIC CULPRITS"; lead order). This PR raised
plans/cmux-next/layer-ownership.md says Rust owns every state, list and rule and Swift is the platform shell. Please move the new logic of this PR in a follow-up: to Rust (the crate that owns the area; the owner lists in STATUS 12147-12165 name the target per area), or at least out of the app into its package. If a declaration above is platform code (AppKit, Core Animation, OS calls, strings, tokens, DEBUG tooling), reply here and the table gets a PLATFORM row with your reason instead. The swift-logic row is a report, not a gate: nothing blocks on this comment. |
Fix-forward for #32276, which was found in the review of #32131. Fixes #32276.
What was lost
Picking another chat from a new chat's tab cleared what the new chat held. That covers the sidebar, New Tab's chat list (
chat.select) and the spare page's adopt (chat.adopt). The host keeps a new chat's text with its tab only until the tab has a session (AgentUnsentDrafts.wireclears it on everyonSessionChange), and a pick and the new chat's own start reach the host as the samechat.persistSession. So two things were lost:Now
persistSession, the page sendschat.leftover {text}with the new chat's kept, held and typed text. The held prompts leave the hold, so none of them is sent later into any chat.AgentUnsentDrafts.leave(_:inWindow:)keeps the text in the window's single slot. The slot sits in the same on-disk file as the tabs' drafts (the relaunch seed's store), so it survives closing the tab and quitting the app. A second leftover is added after the first and never overwrites it. The window comes from the tab's workspace (WindowManager.windowID(ofWorkspace:)).newTab.draft, which its field shows as an editable draft. That covers Cmd-T, a split, a workspace's first page, a restored page, and a chat that becomes a New Tab page (AgentPaneModel.newTabForPage). Nothing sends it. The slot gives up only what a page of its own window reports it showed (chat.leftoverTaken), so a page whose tab never opens loses nothing.The optional native New Tab page (
tabs.nativeNewTabPage, off by default) doesn't take the slot, so the text waits for the next web page. This change adds no navigation change and flips no default.Tests
These were committed before each fix:
UnsentDraftTests.aNewChatsTextLeftWhenItsTabOpensAnotherChatWaitsForTheWindowsNextNewChat:chat.leftoverTakengives up what it showed and keeps what came after;agent-pane-unsent-draft.test.ts:chat.leftoveronchat.select;newTab.draftand acknowledges it once, sending nothing;new-tab-leftover-draft.test.ts: the New Tab page readsnewTab.draft, and a blank one counts as none.trust-held-prompts.test.tsx:Command:
cmux-ci test --setup playwright -- bash -c 'cd webviews && bun test test/agent-pane-unsent-draft.test.ts test/new-tab-leftover-draft.test.ts test/agent-pane-trust-holds-prompts.test.ts test/trust-held-prompts.test.tsx'Observed / Not run
trust-held-prompts.test.tsxlocally: red without each fix (17/2, then 19/1), green with it (20 pass);UnsentDraftTestsandAgentPaneRequestDescriptionTestspass incmux-next swift test.newTab.default,reopenClosedBrowserPanel, export freshness). They come from base's cmux NEXT: vertical tabs per workspace or for all workspaces #32127 and its autofix; this PR changes no actions.cmux-ci testruns only the PR head, so the red commits were not run there.Follow-up filed: #32443, for two New Tab pages that open before either reports showing the leftover.
Risk
Normal: drafts and persistence. The defaults guard flags
NewTabPage.openand.splitonly because their source changed. No setting or default changes. The slot is a reserved key (left-in-new-chat:<window>) inagent-unsent-drafts.json, which no tab id can collide with. Nothing in this change sends a prompt. Chips aren't carried: text only, as with the tab's existing unsent draft.🤖 Generated with Claude Code
Agent session: agent session
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes the loss of a new chat's typed text and prompts held for a trust answer when its tab opens another chat; the text now comes back in the window's next New Tab page as an editable draft.
Bug Fixes
chat.leftoverbefore the switch, so nothing is sent into any later chat and held prompts leave the hold.chat.leftoverTaken) and only to its own window's pages; a page that never opens leaves it for the next one. Every New Tab page made (Cmd-T, split, a workspace's first or restored) receives it asnewTab.draft, shown as an editable draft; a pick from a page holding one leaves it again, edits included, while a query typed to find a chat is not left.Written for commit b719142. Summary will update on new commits.