Cloud start: picking Cloud grants the chip's folder; refusals before Cloud agree
Leo, on the "The app refused the agent connection." card under a failed "Set up a Cloud machine" step: "what happened here on this build?"
Follows #34406, which explained the refusal. This PR removes its cause and folds in that PR's review follow-ups.
Cause
The New Tab folder chip can name a recent project nobody clicked (NewTabScreen.tsx: project = none ? undefined : (recent ?? seeded)). Only a click on a project (onProjectPicked ā workspace.useFolder) grants it, so a Cloud send of the chip's folder was refused by AgentPaneCloudStart.folderInScope with transport.path_outside_roots, by design: Cloud copies the folder off this Mac.
Change
- New Tab: picking Cloud in Run as is the person's pick of the chip's folder.
runMode.onModegrantsenvFolderthroughonProjectPickedon that click. - Composer: its Run as Cloud row grants the folder
sendToCloudnames (composerModeRows,pickFolder). Home and above, and agent-home, ask nothing (cloudStartFolder). folderInScopeis not widened. A Cloud mode that came on by itself through the folder default, with no pick, still gets the host's refusal, which #34406 now words "This folder isn't open in this tab; pick it to send it to Cloud." with no step marked failed. I didn't add a second check on the page: it can't see the pane's roots, so it would also refuse a tab whose own workspace folder is a root.
#34406 review follow-ups
- Web
refusedHerenow uses Swift's list (cloud_attachments,unsupported,unavailable_now,sandbox_busy,sandbox_spent), so an attachment refusal no longer marks "Set up a Cloud machine" failed. unavailable_nowand thesandboxRunsrefusal are logged underapp.cloud, as "refused on this Mac before it reached Cloud (nothing was sent)".- Swift test
aRefusalHereIsTheRefusedHereCode, plus web tests incloudStartProgress.test.ts.
Risk: low. A Cloud pick now grants the one folder the chip names, which a click on that project already granted.
Agent session: agent session
š¤ Generated with Claude Code