Skip to content

New Tab: a project picked there goes with a Cloud start (copied to the machine at its branch with local changes) - #29789

Merged
teamleaderleo merged 1 commit into
feat-cmux-nextfrom
lane/cloud-carry-project
Nov 1, 2026
Merged

teamleaderleo merged 1 commit into
feat-cmux-nextfrom
lane/cloud-carry-project

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Leo, 2026-10-31: "JUST PASSING THE SELECTED FOLDER/'PROJECT' WHEN YOU PICK CLOUD THAT'S THE BEST WAY. IT JUST GOES IT JUST WORKS". Also: "CODEX/CHATGPT CLOUD JUST WORKS. WE ALL HATE SETTING UP ENVIRONMENTS".

What was wrong

The Cloud start already carries the selected project: cloud.startChat (#28111) copies the chat's folder to the person's Cloud machine through Move to Cloud's sync (cmux link sync push, Rust), which takes a git working copy together with its .git. That brings the remote (minus URL user info), the branch, HEAD, index, stash, uncommitted changes and untracked files that aren't ignored. A folder outside git is copied file by file. Then the chat starts in that copy. No environment form is involved.

The New Tab page broke that path. cloud.startChat copies only the pane's own folders (AgentPaneHandOff.folderInScope: its roots and folders the person picked). A recent project picked on New Tab changed only page state, so a Cloud send from it was refused with pathOutsideRoots. This was found in #28686's review and tracked in #29294 (P2, "New Tab's Cloud send skips folder authorization"). The chat composer's own folder chip already hands its pick to the host (chooseProject → workspace.useFolder).

What changes (web only, no Swift)

  • NewTabScreen gets onProjectPicked(cwd), called from pickProject when the person picks a folder on this Mac (folder chip, widget card, Choose Folder, new worktree).
  • While Cloud is offered, App.tsx sends that pick to the host on the click (pickFolder → workspace.useFolder), the same call the chat composer's chip makes. It skips folders Cloud would never copy (home or above it, per cloudStartFolder). A home or root answer asks nothing here; the local start still asks on Return.
  • Why on the click and not on Return: grantPicked spends a gesture credit. Granting on Return would leave cloud.startChat without one and fail it with gesture_required. The click's credit pays for the grant, and Return keeps its own credit for the start.
  • The host's scope check is unchanged, as Composer Cloud: follow-ups from #28686's review (folder default, stuck Cloud pick, card facts) #29294 asked.

Prior art read

#28111 (cloud.startChat, the copy), #29046 (moves the start's pick, ledger and copy to Rust; open, stacked), #28686 and #29294 (Composer Cloud and its follow-ups), #29669 (Start New Chats In: Cloud), #29145 and #29556 (~/work default), #28823 (fs-v1 on a fresh VM), #19448 (Move to Cloud transfer). cmux-platform's derived environments (POST /v1/environments/derive) clone a repo from its remote. They don't carry local uncommitted changes, so this keeps the local copy path.

Tests

  • New: a project picked on the page is reported on its click (onProjectPicked), so Cloud can copy it.
  • Fleet run: NewTabScreen.test.tsx plus cloudRun.test.ts, 33 pass, 0 fail, and tsc --noEmit clean (run).
  • DEV-build verification on the Cloud test account: added in a comment below.

Follow-up (not in this PR): the first push of a large repo uploads its whole .git. A clone from the remote plus a push of only the local delta would be faster, but it needs git credentials on the machine, so it waits for the credential relay work.

Agent session: agent session

🤖 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

Fixes the New Tab page so a project picked there is carried into a Cloud start, copied to the Cloud machine with the chat.

Previously, picking a recent project on New Tab only changed page state, so a Cloud send from it was refused with pathOutsideRoots (#29294). The pick is now handed to the host on its click (workspace.useFolder, the same call the chat composer's folder chip makes), and cloud.startChat copies the pane's folders including that picked project. Only folders Cloud would copy (never home or above it) are handed over, and only while Cloud is offered; the local start still asks on Return. The hand-off happens on the click rather than Return because the grant spends a gesture credit, and Return's credit must stay available for the start. Web-only, no Swift changes.

Written for commit c1f4595. Summary will update on new commits.

View guided diff Turn on auto-fix

…copies it

A Cloud send copies only the pane's own folders (AgentPaneHandOff.folderInScope).
A recent project picked on the New Tab page changed only page state, so a Cloud
start from it was refused (pathOutsideRoots, #29294). The pick now goes to the
host on its click (workspace.useFolder, as the chat composer's chip does); the
grant spends that click's gesture, leaving Return's for cloud.startChat.

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

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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

Review c1f4595: 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=pr29789 -f ref=lane/cloud-carry-project -f platform=macos -f backend_mode=local

Gallery before/after for c1f4595: 16 states rendered, 0 images differ, 1133 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41253266781 -R manaflow-ai/cmux -n gallery-advisory-29789-c1f45951e456438ec703bd29fa57e00769f178de (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.

Shipped in:

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

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

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at c1f4595

Reviewer: codex gpt-6.1-sol xhigh, fast tier.

Follow-ups: 1. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward.

SHIP at c1f4595

Visual verdict: all 16 supplied after images match their before counterparts; no UI regression.

  1. [P2][follow-up] App.tsx:12444 only supplies onProjectPicked after asynchronous sandbox.checked becomes true. The New Tab remains interactive before that check completes, so a user can pick a project first, then see Cloud become available; that earlier pick is never sent through workspace.useFolder, and the subsequent Cloud start still fails with pathOutsideRoots. Preserve/replay the picked folder when Cloud becomes offered, or attach the callback independently of the check.

Follow-ups:

  • [P2][follow-up] App.tsx:12444 — replay project picks made before sandbox.checked becomes true.

@teamleaderleo
teamleaderleo merged commit 8d132b6 into feat-cmux-next Nov 1, 2026
199 of 211 checks passed
@teamleaderleo
teamleaderleo deleted the lane/cloud-carry-project branch November 1, 2026 00:09
teamleaderleo added a commit that referenced this pull request Nov 1, 2026
…Cloud start (#29926)

onProjectPicked was attached only once sandbox.checked was true, so a
project picked on the New Tab page while the host's check was out never
went through workspace.useFolder and the Cloud start could still fail
with pathOutsideRoots (review of #29789). The callback is now attached
whenever Cloud may be offered, the check aside (newTabProjectPick).


Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: cmux-bot[bot] <348531757+cmux-bot[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
ci-routing-agent — c1f45951 Deployed Oct 31, 2026 by teamleaderleo via wait for same-key tree publisher #91933
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