Skip to content

cmux NEXT Cloud: pick a chat's machine from its folder, sent as autosize (no machine or size prompt) - #26740

Merged
teamleaderleo merged 7 commits into
feat-cmux-nextfrom
leo/cloud-autosize-pick
Oct 30, 2026
Merged

teamleaderleo merged 7 commits into
feat-cmux-nextfrom
leo/cloud-autosize-pick

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

What

A chat sent to cmux Cloud gets its machine chosen from the chat's folder, with no machine, size or environment prompt.

CloudWorkPick (CmuxNextCloud) reads, from the chat's working directory:

  • the repo key (host/owner/name, lower-cased) from the remote, never a login or password from the URL;
  • the GitHub repo a new machine can clone, at the current branch when it is pushed (an unpushed branch clones the default branch);
  • the checkout's git object size and its root file names (Package.swift, Cargo.toml, package.json, …), which give the server the toolchain;
  • the task kind. The rule is simple and documented on CloudTaskKind.inferred(from:): a whole word naming testing makes it test, else a word naming building makes it build, else chat. It reads the chat's title;
  • whether .cmux/machine.toml exists, and whether the agent is Codex (which needs the Codex broker).

Every git command is local, with no network, and bounded at 3 s. A command that fails just leaves its fact out. A folder outside git gets no repo, and its root files still go.

Where it's used:

  • Move to Cloud when there is no machine to reuse. The existing reuse order (the named machine, else a connected one, else any) is unchanged.
  • New Cloud Machine asked from a chat (the composer's row names its tab). The setup offers the chat's own repository as the starting point. The machine is sized for the chat only when the person keeps that repository.

Both send autosize: {taskKind, repo: {key, sizeMb, rootFiles}} with POST /api/vm (#26617, #26630). A memoryMb still wins.

The answer's sizePick {vcpus, memoryGb, pick, reason} is decoded on CloudMachine.sizePick. It is also kept on CloudMachineSession.sizePick, which a list read does not overwrite. That copy is what the hand-off reads: CloudSizePick.handoffSize is POST /v1/handoffs's size.

Why

Leo, 2026-10-28: "whatever's convenient for cloud, like that can be productionized, operationalized, we ought to just put out there"

Leo, 2026-10-28: "like as auto as chatgpt work and not NEEDING to deal with picking environments... the auto thing situation". And: "You know how we did that automatic routing, automatic sizing ... We want to have that for the cloud machines too ... Like ChatGPT work."

Risk

  • Everything here is behind Labs preview features, the design's rule for new work-mode surfaces. With Labs off, nothing is read and every create is byte-for-byte as before.
  • With Labs on, a moved chat's new machine takes the server's pick instead of the plan's default size. A plain chat may get a smaller machine than before; that is the server table's call (web: auto-size a handed-off task's cloud machine (fleet sizing model) #26617).
  • Reading the pick runs up to five local git commands and one directory listing, only when a machine is about to be created.
  • No new strings and no UI change. The setup dialog's starting point is prefilled only for a chat in a GitHub repo, with Labs on.

Tests

CloudWorkPickTests covers:

  • a Swift package, Rust and Node repos with GitHub and non-GitHub remotes;
  • unpushed branches;
  • a non-git folder;
  • the task-kind rule;
  • that remote keys never carry credentials;
  • the upstream track parse;
  • sizePick decoding, where a malformed one drops the line and never the machine;
  • that the setup is sized only for the chat's own repository.

CloudWorkspaceSetupWizardTests covers the suggested starting point. These ran as package tests on the Mac fleet.

No capture: with Labs preview features off (the default), nothing changes on screen. With Labs on, nothing new is drawn either. The one visible difference is a field's starting value: when New Cloud Machine is opened from a chat's composer, its setup dialog starts on "From repository" with the chat's own repo filled in (CloudWorkspaceSetupWizardTests.aChatsRepositoryIsTheSuggestedStartingPoint). No capture scene opens that dialog from a chat. The size line in the chat is the follow-up UI PR, which comes with before/after captures.

Agent session: agent session

🤖 Generated with Claude Code

@teamleaderleo

teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@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 01564b7: 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=pr26740 -f ref=leo/cloud-autosize-pick -f platform=macos -f backend_mode=local

web and size checks: green

@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-egdz7x created for this PR by the cmux coordinator.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra): SHIP at d3b4891

Three rounds of review at high effort with fast mode. Round 1 found three issues, all fixed in d3b4891:

  • The clone ref now names the upstream's branch, not the local branch.
  • A local-path remote names no GitHub repo.
  • No pick is read on the app-server link, whose create takes no autosize.

Round 2 asked about isDefault. The answer, with code lines, is that autosize is set only from a pick that requires the legacy link, and the configuration is immutable. Round 3 verified it and returned SHIP with no findings.

teamleaderleo and others added 2 commits October 28, 2026 00:23
…ze, task kind), sent as autosize

A chat sent to Cloud no longer needs a machine or size choice: CloudWorkPick reads the chat's
folder (repo key and GitHub repo from the remote, branch and whether it is pushed, git object
size, root files, task kind, .cmux/machine.toml, Codex broker) and Move to Cloud with no machine
to reuse, and New Cloud Machine from a chat, send its autosize with POST /api/vm. The answer's
sizePick stays on the machine's session for the hand-off. Behind Labs preview features.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-4ba8980ae4e8eecb82d6
…o from a local remote, no pick on the app-server link

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

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra): SHIP at 9b73ba6

The same reviewed change, rebased onto feat-cmux-next to pick up #26754, which fixes the base Release-compile red (CloudHandlers+Account.swift:146, not this change's line). The diff is identical to the reviewed head d3b4891: git patch-id --stable gives 5fcae646 for both.

@blacksmith-sh

blacksmith-sh Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
test_every_listed_hook_is_one_glaeda_released_with_the_check (main.SigningHooksInSt
epWithGlaedaTests.test_every_listed_hook_is_one_glaeda_released_with_the_check)/
test_every_listed_hook_is_one_glaeda_released_with_the_check (main.SigningHooksInSt
epWithGlaedaTests.test_every_listed_hook_is_one_glaeda_released_with_the_check)
View Logs
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)/
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Resolves the setup wizard against base's Cloud environments: choosePlan takes both
the chat's suggested repository and the team's environments; the handler sizes the
request for the chat and still saves a new environment before booting it.

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

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra): SHIP at 8a93094

Delta review of the hand-resolved merge of feat-cmux-next into this branch: the remerge diff, the full PR diff against the merged base, and the full resolved files. No findings. Still held by the fleet-wide Swift merge hold (HOLD line in the body).

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Orphaned: no activity for 15 h, and no lane holds a lease on it. Adopted by the orphan sweep: merged feat-cmux-next in at 2b98a87. A later pass queues it for the merge hub if it is reviewed, small and red only on base reds.

…utosize-pick

# Conflicts:
#	Packages/macOS/CmuxNext/Sources/CmuxNextCloud/API/CloudMachine.swift
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, fast, via review-router): BLOCK at dcf23b5

  1. P2 — Incorrect branch selection for remapped tracking refs — CloudWorkPick.swift:77. upstream:lstrip=3 strips components from the local tracking ref, which need not match the remote branch. For example, remote team/origin tracking feature produces origin/feature. Accepting the suggested repository then provisions a machine whose bootstrap fails because that branch does not exist. Use upstream:remoteref, remove its refs/heads/ prefix, and add tests for slash-containing remote names and custom fetch mappings.

Static review only; tests were not run in this sandbox.

…ref's tail

A remote named team/origin made %(upstream:lstrip=3) answer origin/feature, a
branch the machine's clone cannot find. Read %(upstream:remoteref) instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-5160a5704f7bd6c329fa
…lder

- Name the branch's upstream remote when reading its URL, and pin with a test
  that a fork as origin beside a tracked upstream picks the upstream repo.
- New Cloud Machine from a chat whose tab has no cwd cached reads the folder its
  local session reports, as Move to Cloud does.

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

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, fast, via review-router): SHIP at 01564b7

  1. P3 — CloudWorkPick.swift:127: maxSplits: 1 leaves the remote-name field inside track. A synchronized branch tracking a remote named ahead is therefore classified as unpushed, causing the wizard to suggest the default branch. Inspect only the second NUL-delimited field and add a three-field regression test.

No P1/P2 findings. Static review only; tests were not run.

@teamleaderleo
teamleaderleo merged commit c62a8db into feat-cmux-next Oct 30, 2026
146 of 152 checks passed
@teamleaderleo
teamleaderleo deleted the leo/cloud-autosize-pick branch October 30, 2026 03:49
@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40999472385 at c62a8db failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at cfcbe8d. This pull request is one of 1 merged since: #26740.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

teamleaderleo added a commit that referenced this pull request Oct 30, 2026
Resolves conflicts with #26740 and #26568: keep the palette actions, keep
this PR's removal of the agent pane's sign-in fallback, and pass #26740's
chat pick into bindMachineCreation (read when the action runs, since sign-in
may finish after focus moved).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-5160a5704f7bd6c329fa
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

lawrencecchen added a commit that referenced this pull request Oct 30, 2026
The slice head 2b2fc8e (= 43037147a0b's tree: slice + trunk sync c09bb74) merges the feat tip, 130 new
commits. 58 files conflicted:
- 0 reuse the previous round's resolutions: this round's base is the previous feat tip a14725a, so no hunk had
  all three sides equal to 5f39f9e's inputs.
- Regenerated, not hand-merged: the 4 CmuxMessagesLab patches (Fixture, Layout, RowDrawing, WindowView) from the
  merged vendored sources against the pinned upstream reconstructed from the side whose patch was consistent (feat's
  for 3, perf's for WindowView; feat 65de604 edited WindowView.swift without rewriting its patch).
- 54 resolved by porting feat's change into perf's shape:
  - Package.swift (CmuxNext: Floating tests get CmuxNextDesign with perf's Wakeups deps; CmuxMobileKit: Model gets
    feat's Resources with perf's CmuxSafeConcurrency).
  - Lineage parents #24136: SidebarSessionTreeFeed (recordedParents and per-host links on perf's ServiceObservation),
    RemoteAcpmuxWire (host/linksAlias notes posted on perf's mainWork; test-only inits take them too),
    AgentTabRemoteHost, AgentTabs+Wiring, AgentSessionWorkspace (the record is one completion task on main), tests.
  - Artifact sandbox #26216: perf's page-host PageArtifactFrame already serves the sandboxed endpoint; feat's
    navigation tests ported to PageNavigation, frame-ancestors expectation added, artifactFrameURL keeps only the
    page host, webviews tests on perf's URLs.
  - pane.commandAvailability (#25405) and chief.face (#27914) beside perf's keyToPaint and Wiring init.
  - State files off main #27749: AgentUnsentDrafts (perf's ObservedMap) and ScrollAnchors (blockingDecode) on
    AgentPaneStateFile.
  - AgentPaneTransport.close: perf's close reason plus feat's host-request failure and trust reset.
  - CloudService: perf's file, plus #27104 signedOutCreation (scope, policy, stop, signOut in +Machines) and #26740
    autosize/sizePick; listIsCurrent moved to +AppServer as feat did.
  - debug.object_menu into perf's DebugDriverControl; Home fixture presence/faces beside perf's field.
  - Palette overlay window #26951 into perf's paletteBuilt.
  - Per-window Home #27880 in perf's dockTab helper; active team (1bb1b96) on perf's cloudAuth.
  - Busy refusal (a930474, 2a9b813) in perf's LineTransport split (+State, +Route, framed write).
  - Launch snapshot sidebar doc (dc38061): DaemonLaunchSnapshot.sidebarDoc, shown once settled
    (whenSettled), its connect follow a ServiceObservation; the Rust test moved to launch_snapshot_tests.rs.
  - Hover card corners (bc66475) with perf's interactive flag; Chief pet state (#25671) on perf's
    ServiceObservation and AppearanceSignals; Chief picture crop (#27933) on perf's lanes and optional store;
    Home presence (#25578) as a FrameObservation; sidebar tab look (#27530) via SidebarLookFollower; settleOpenings
    (#24374) with perf's snap; Omnibar imports.
  - acpmux: inbox digest senders without slicing; withdraw_queued async with from_agents_only; cmux-tui-core and
    platform: connection leases beside perf's modules and InlineSocket (bounded_outbound.rs takes back the
    `platform::transport` import perf had dropped, which feat's claim_watched_connection names).
  - webviews: App/NewTab/NewTabScreen (retry, slash commands, at), settings keys moved to cardRows.ts.
- Feat's tests that call perf-changed inits fixed: TabConcentricCornerTests (input:), HomeChatPresenceFacesTests
  (deadlines:, frame delivery), RemoteChildSessionsTests (main run loop for posted notes).

Generators: cargo metadata in cmux-tui, cmux-tui/fuzz, Native/DiffSidecar and optchat-chief changed no lock;
gen-features.py --check, gen-chromium-host-wire.py --check and --check-ops, sync-resource-api.py --check pass.
webviews: bun run check passes. schemas/settings/settings-schema.json stays perf's (generated; the autofix
regenerates it): until then feat's chiefLook.test.tsx misses the home.bubbleColors rows.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 01564b75 Deployed Oct 30, 2026 by teamleaderleo via cmux-tui tree preflight #79220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant