Skip to content

Add destination-aware New Agent Chat - #27071

Merged
teamleaderleo merged 38 commits into
feat-cmux-nextfrom
lane/nx-settings-new-chat-host
Oct 29, 2026
Merged

teamleaderleo merged 38 commits into
feat-cmux-nextfrom
lane/nx-settings-new-chat-host

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Adds “New Agent Chat on…” using the same acpmux status peers and signed-in account Cloud inventory consumed by the composer Environment picker. Offline peers stay visible and disabled with their actual state. Ready Cloud destinations connect through the existing machine path before opening a chat. Palette selection forwards to the shared New Agent Chat action, also exposed as cmux agent new-chat --cwd /tmp --harness codex --model M --host H and through MCP. --machine is an alias for --host.

Explicit startup arguments survive the targeted and untargeted creation paths, seed peek/take, and page handshake; --cwd /tmp reaches the new chat instead of being dropped. No-argument Cmd-I retains its existing dock/inheritance behavior. Environment and model picker components and defaults are unchanged. Remote model selection uses an additive capability; an old daemon refuses an explicit unsupported model rather than silently using its default.

Leo: “Are you guys able to, like, okay, simultaneously, like through the CLI and through commands, through maybe even slash commands in the command palette, are you able to do stuff? Am I able to do stuff, like with this current version of the app? And in addition, of course, like clicking around, starting up a new workspace, a new tab, a new chat. How ergonomic is that? Are the things properly exposed?”

Observed / Not run

Latest Swift repair at 9bc791af951f98b4473083dfe55ee71ea1a30da8: a Cloud chat seeded with a harness and model now inherits that model only while the effective harness still matches the seed. Choosing another harness's default before Send no longer restores the previous model. The tests-first ancestor 9e96ca338b6b32ca6eb0dcc838311f2cd42724b6 adds six cases through the real remote-start client and a bounded daemon socket, observing the actual start request and resulting remote session. It covers changed-harness default selection, unchanged-harness inheritance, and explicit model overrides. Red-first and final focused Mac execution plus a fresh independent review are pending; the earlier Mac receipt does not validate this new Swift delta. Static checks and primary diff review pass. Web sources/tests are unchanged from the passing run at f875db35ba83522bd06f8b548e7d081ee0c225bc (web tree 454d181a09dd6b3ba36a8e5974e11e4cbb95002c).

Focused final Mac command: cmux-ci run --class light --script scripts/ci/package-test-lane.sh --ref 9bc791af951f98b4473083dfe55ee71ea1a30da8 --arg=suite --arg=Packages/macOS/CmuxNext --arg=AgentTabRemoteStartTests,AgentChatInUnshownPaneTests,AgentChatDestinationsTests,AgentChatDestinationActionTests.

The latest web-only repair keeps the seeded peer when a failed startup is retried through the actual composer Send action. Local prewarming stays disabled while that peer startup is pending. The tests-first run 40868154083 at 3fcdb86bc935ed084b24cdfb94224323e7f01f2c passed full web checks and 13 tests, but failed the new browser regression: typing a prompt and pressing Enter sent it to local-session-1 instead of peer-session-1. The fixture accepts local starts so wrong routing cannot hide behind another rejection. It also verifies one connection, remote cwd/harness/model, peer persistence and no local prewarm. Exact-head repaired run 40868640127 passes all 14 tests with 69 assertions, plus full formatting, lint, type and protocol checks (source/head f875db35ba83522bd06f8b548e7d081ee0c225bc, tree b183edc0b7ec0a17a5968bd94e4b8dbf72efdfef, exit 0). Swift sources and tests are unchanged from the final Mac receipt below.

The latest repair retains Cloud catalog identities when their names match peers; raw and prefixed Cloud UUIDs remain selectable with the Cloud machine’s own state. A successful peer start also consumes its remote folder, so a subsequent local chat cannot inherit it. Tests-first run 40861950540 at 867294fbf3b7f7eb0f9662c3de6067e96865e423 reproduced both remote-folder leakage cases (8 pass, 2 fail); the explicit local-inheritance test passed. Repaired web run 40862282590 targeted d134a3dccbbae7e9fec5cbee23710d263c29af39; the final delta only strengthens a Swift assertion to require concrete workspace IDs. The exact final-head run 40863563011 passes all 13 tests with 53 assertions, plus full formatting, lint, type and protocol checks. Its source and final SHA both equal bba8c8a839f7ce18324c10c004feab7c139857ed (tree cd65917c9079af976eda092d3494d3a4b33989dc, exit 0).

Current head: 9bc791af951f98b4473083dfe55ee71ea1a30da8. Static prepush checks and git diff --check pass. The earlier focused web run 40858020485 passes all 10 tests, with 43 assertions, plus the full web formatting, lint, type and protocol checks. Formatting produced no diff. No local builds or test suites were run.

The tests-first run 40857373140 at 60ada1ab167feeb41702062c4bf719be5b5068ad had 7 passes and 3 failures: rejected peer folder/model startup and subsequent Send losing the peer. The repaired browser tests prove one handshake, one live connection and one creation attempt after a rejection, then a successful corrected retry and persistence on the same connection. A rejected startup now reports the error on that connection; it does not enter handshake backoff. A later Send retains the seeded peer and folder until creation succeeds. Successful creation consumes the optional harness/model/peer startup choices.

Focused web command: CMUX_BROWSER_TESTS=1 bun test --timeout 120000 test/agent-pane-peer-chat.test.ts test/agent-chat-seed-start.test.ts from webviews/, through cmux-ci test --setup playwright. The earlier startup-model regression also has red/green evidence.

Final-head Mac step b37281515b78b493bbafdc47 at bba8c8a839f7ce18324c10c004feab7c139857ed passed AgentChatDestinationsTests (5 tests), AgentChatDestinationActionTests (6 tests, all parameterized cases), and both targeted/untargeted created-page cwd tests. The only failures were the two unchanged legacy tests aScriptOpensAChatInAWorkspaceNoWindowShows and aScriptOpensAChatInAShownPaneWithoutChangingItsSelection: the same tab-membership assertions failed on the same machine at merge base 67053da36d1f9f64cdae110669976723c53703b8 (step ce108610d4fcd0491195d8d2). No crash occurred. Those legacy tests also passed in the product-identical d134a3dc run on another fleet Mac (step cef436cd6a1de11ec97e7859), confirming the machine-dependent failure.

Mac red-first step 1c556569362516668c67ffe6 at tests-only head 867294fbf3b7f7eb0f9662c3de6067e96865e423 failed three catalog tests because same-name Cloud entries and stable ID routes were missing; all pass in the repaired runs. The fixtures await tracked creation and the authoritative tab, and isolate the external handshake host while retaining real daemon folder resolution. Local tests request /private/tmp literally and assert exact created-page cwd equality. Explicit targets assert the exact pane; untargeted actions assert the same workspace while preserving chat-dock placement.

Mac command: cmux-ci run --class light --script scripts/ci/package-test-lane.sh --ref bba8c8a839f7ce18324c10c004feab7c139857ed --arg=suite --arg=Packages/macOS/CmuxNext --arg=AgentChatInUnshownPaneTests,AgentChatDestinationsTests,AgentChatDestinationActionTests.

Resolved dependency: #26809 repairs the broad Swift test harness; this PR has no product-code dependency on it. The blanket Swift hold is resolved for this PR because focused Mac step b37281515b78b493bbafdc47 covered every new Swift case on the unchanged harness, completed without a crash or cut-short run, and its only two failures match the same named tests and errors on base step ce108610d4fcd0491195d8d2. The Swift package tree is identical at the earlier head f875db35ba83522bd06f8b548e7d081ee0c225bc and the tested head bba8c8a839f7ce18324c10c004feab7c139857ed: 3d2660a98999b970c812b2eabe640d7201a86121. Landing this PR no longer waits for #26809.

Fresh-home live session-state proof, public-fixture before/after palette captures and independent exact-head review at 9bc791af951f98b4473083dfe55ee71ea1a30da8 remain pending. Created-page cwd tests do not replace live session cwd/harness/model and peer sidebar evidence.

Overlap: #25405 and #23071 touch the creation flow in AgentHandlers.swift and AgentHandlers+Pane.swift; #23071 also overlaps the seed/ready handling in AgentPaneHandshakeReply.swift. These changes stay on this PR’s branch; whichever overlapping PR lands later rebases. This is one creation lifecycle across the native action, page and remote protocol. The larger diff includes 390 lines of translations plus regression coverage, so splitting would leave incomplete argument routing.

Risk: an explicit destination now reads live availability before creating the tab. Unknown/offline destinations fail without a local fallback; account ownership is rechecked after Cloud connection. No reverse relay allowlist or trust policy changes are introduced. Palette styling and fade remain unchanged; cached rows show immediately and refresh work is canceled with the page.

Review and verification at 9bc791a

  • Independent review (Codex gpt-6-astra, high): the full PR at f875db3 had one finding (the model fallback ignored a harness switch); the delta f875db3..9bc791a fixes it, SHIP.
  • Fleet Mac, red first: at 9e96ca3 (tests only) changingHarnessBeforeSendUsesItsDefaultModel fails (the Claude seed model was sent to Codex); at 9bc791a AgentTabRemoteStartTests 3/3 (6 cases), AgentChatInUnshownPaneTests 4/4, AgentChatDestinationsTests 5/5, AgentChatDestinationActionTests 6/6, with no crash and no cut-short run.
  • The web tree is unchanged since f875db3; web receipt run 40868640127 (14/14) carries.

Before / after (fresh home, fleet capture, live peer)

A second acpmux daemon runs in the capture slot as peer pf (a fake harness, its own temp home). Acceptance at 9bc791a:

  1. cmux agent new-chat --host pf --cwd /private/tmp opens the chat on the peer (session/new answered "peer":"pf"; no local session).
  2. Composer Send runs on the peer (session/prompt answered "peer":"pf").
  3. First start refused by the peer (trust.pending); the composer Send retries session/new on pf, not locally, and the prompt is answered there.
  4. Palette: "new agent chat on" selects "New Agent Chat on…" (base 67053da selected "Animations…"). Text readout only: the capture driver can't image the palette panel.
  5. A peer whose daemon is down is refused ("the machine is not connected"), with no local fallback (checked at f875db3).

Known follow-up: after the retry in (3) succeeds, the stale "Trust tmp?" card from the refused first start stays visible; it gets its own PR.

Composer New Chat on a peer host, retry after a failed first start:

Light Dark
light dark

New Agent Chat on a peer host, prompt runs on the peer:

Light Dark
light dark

Changelog

Added: Choose a peer or Cloud machine when starting an agent chat, and pass a folder, harness and model through CLI or MCP.

agent-identity footer --repo manaflow-ai/cmux: https://cmux.com/deeplink/agent?id=aid-812ea78d4e52585d9c37

Pass cwd, harness, model, and host through the shared action seed for palette, CLI, and MCP starts. Preserve no-argument Cmd-I and relay remote model starts through an additive daemon capability.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-812ea78d4e52585d9c37
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 09d0bf4: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr27071 -f ref=lane/nx-settings-new-chat-host -f platform=macos -f backend_mode=local

Passes: CI passes on 09d0bf461e.

CI passes on 09d0bf461e (run 40908020426 attempt 1).

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base c14dc66; does not block

Gallery before/after for 09d0bf4: 16 states rendered, 0 images differ, 2244 more touched states not rendered. Images are in the run's artifact, not on this public PR.

gh run download 40908020022 -R manaflow-ai/cmux -n gallery-advisory-27071-09d0bf461e7c3b29b30cb1ef77bc8de3f4383c84 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.chat-width/standard Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/standard Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/short-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/short-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/wide-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/wide-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/no-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/no-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-floats/scrolled-to-end Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-floats/scrolled-to-end Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-floats/composer-grown Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-floats/composer-grown Apple System Colors unchanged 0% own App.tsx
agent-pane.continuation-spacing/shipped Apple System Colors Light unchanged 0% own App.tsx
agent-pane.continuation-spacing/shipped Apple System Colors unchanged 0% own App.tsx
agent-pane.continuation-spacing/two-thirds Apple System Colors Light unchanged 0% own App.tsx
agent-pane.continuation-spacing/two-thirds Apple System Colors unchanged 0% own App.tsx
agent-pane.continuation-spacing/half-tucked Apple System Colors Light unchanged 0% own App.tsx
agent-pane.continuation-spacing/half-tucked Apple System Colors unchanged 0% own App.tsx
agent-pane.continuation-spacing/before Apple System Colors Light unchanged 0% own App.tsx
agent-pane.continuation-spacing/before Apple System Colors unchanged 0% own App.tsx
agent-pane.copy-controls/output Apple System Colors Light unchanged 0% own App.tsx
agent-pane.copy-controls/output Apple System Colors unchanged 0% own App.tsx
agent-pane.docked-chat/new-chat Apple System Colors Light unchanged 0% own App.tsx
agent-pane.docked-chat/new-chat Apple System Colors unchanged 0% own App.tsx
agent-pane.docked-chat/after-turn Apple System Colors Light unchanged 0% own App.tsx
agent-pane.docked-chat/after-turn Apple System Colors unchanged 0% own App.tsx
agent-pane.docked-chat/working Apple System Colors Light unchanged 0% own App.tsx
agent-pane.docked-chat/working Apple System Colors unchanged 0% own App.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Default changes

This pull request changes 5 defaults at 09d0bf461e7c (what everyone gets without configuring anything):

  • tunable-source.CmuxNextApp/Handlers/AgentHandlers.swift:bind: "16e3f7aeaa396d1177bb5d6cacbf7ebf7bf18a5dec6ac5bdf171e7e97038d955" -> "199a014a494c8d764211e801d4922f00edc79f4296fd043d9c7be0bfeae27d57"
  • tunable-source.CmuxNextApp/Handlers/AgentHandlers.swift:openNewAgentChat: "60be85703c085dedd5b766105d871752e54a2a5e6c3b83bd6ac99a6ad8e86c61" -> (none)
  • tunable-source.CmuxNextApp/Handlers/DockedAgentChat.swift:open: "ef33c3f823b9ecf8e6b2e94f88f9f6e46d0c9d208870f676a9e076893ecc7978" -> (none)
  • tunable-source.CmuxNextApp/PaletteSourcesBridge.swift:agentChatTargets: (none) -> "102fcecb085211e97e5e9bdf3ed012cd68f488d032ba9221cc77bd44b451dc0f"
  • tunable-source.CmuxNextApp/PaletteSourcesBridge.swift:targetSource: "8bba847a65aed2f06776058fa2ea4f39f405da52bf3a728e713594a5c9ea7700" -> "7d7e0a99f7a28f7090a41185b30c65c475387daf9bb95b1db54a381b01ecafca"

Signed off on this commit by review (independent direct read of a one-line docs delta).

Merge receipt: merged as 8de7aaa09c09 with these defaults changed, signed off by review (independent direct read of a one-line docs delta).

Regenerate the snapshot with python3 scripts/ci/defaults_guard.py snapshot.

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

Copy link
Copy Markdown
Collaborator Author

Bead cx-401f80 created for this PR by the cmux coordinator.

Keep folderless peer starts folderless through the native transport. Normalize a resolved local destination before seed creation so its display name is never forwarded as a peer.

Tests-first commit: 1b819e0. Focused native transport and created-chat regression execution requested from fleet; no local build or suite run.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-812ea78d4e52585d9c37
Local is a known ready destination. Resolve it before peer and Cloud inventory reads so an unavailable remote cannot stall host=local. The regression holds both inventory providers pending and observes local tab creation.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-812ea78d4e52585d9c37
Generated-only: pr-autofix-patch artifact 12902839196 (run 40885292161) at 7478e29.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-9fb83d5824c20e6db59b
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra, independent): SHIP at e528d5c

  • Delta review of 6749388..e528d5c. Only the test changed: the timeout task cancels the work and releases both inventory gates, so the test cannot hang. No assertion was weakened, and no product or generated file changed.
  • Red first: e528's test file on the code from before the fix fails aPeerNamedLikeTheLocalTitleStillCreatesOnThePeer in 0.4 s. No hang, no crash.
  • Green at e528d5c on a fleet Mac: AgentChatDestinationsTests, AgentChatDestinationActionTests and AgentTabRemoteStartTests all pass, with 0 failures.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (independent direct read of a one-line docs delta): SHIP at 09d0bf4

  • e528d5c..09d0bf4 changes only release-notes/next/highlights/new-agent-chat-destination.md. It adds action: palette.newAgentChatOn | Try it, and that action exists in AgentActionCatalog.swift.
  • The code at e528d5c already had a Codex gpt-6-astra SHIP: red first fails the title-alias regression, and the three suites are green on a fleet Mac. This commit changes no code, tests or generated files.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

This branch was previously deployed

3 inactive (2 outdated) deployments
ci-routing-agent — 09d0bf46 Deployed Oct 29, 2026 by teamleaderleo via wait for same-key tree publisher #77385
artifacts — 7e1c7aeb Deployed Oct 29, 2026 by teamleaderleo via publish the Windows daemon to R2 #77158
sentry-dsyms — 7e1c7aeb Deployed Oct 29, 2026 by teamleaderleo via upload cmux-tui dSYMs to Sentry #77158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants