Skip to content

Cloud start: a send waits for the Cloud pick's folder grant - #34427

Merged
teamleaderleo merged 1 commit into
feat-cmux-nextfrom
claude/cloud-start-await-folder-grant
Nov 4, 2026
Merged

teamleaderleo merged 1 commit into
feat-cmux-nextfrom
claude/cloud-start-await-folder-grant

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

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?"

Fix-forward of the #34415 review follow-up. Picking Cloud granted the chip's folder fire-and-forget (void pickFolder), so a Return right after the pick could reach cloud.startChat before workspace.useFolder finished and still be refused as path_outside_roots.

Change

  • App.tsx: cloudFolderGrant keeps the last Cloud pick's grant promise, from the composer's Cloud row and from the New Tab pick. The Cloud start's native call (oneCloudStart) waits for it first; a failed grant still lets the start go, and the host words its refusal (Cloud start: a start refused on this Mac says why, and marks no step failed #34406).
  • cloudRun.ts: newTabProjectPick takes an optional granted callback that receives the promise. Test in cloudRun.test.ts.

Risk: low. A Cloud start waits at most as long as the grant that is already in flight.

Agent session: agent session

🤖 Generated with Claude Code


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


Summary by cubic

Fixes a race where pressing Return right after picking Cloud could start before the folder grant completed, getting the Cloud machine refused as path_outside_roots.

The Cloud pick's folder grant (workspace.useFolder) now keeps its promise, and the Cloud start waits for it before sending. A failed grant still lets the start go, so the host's refusal wording is unchanged. Risk is low: the start waits at most as long as the grant already in flight.

Written for commit 6ef05ea. Summary will update on new commits.

View guided diff Turn on auto-fix

Picking Cloud granted the chip's folder fire-and-forget (#34415), so a
Return right after the pick could reach cloud.startChat before
workspace.useFolder finished and still be refused as path_outside_roots.
The grant's promise is kept (cloudFolderGrant), from the composer's Cloud
row and the New Tab pick (newTabProjectPick's `granted`), and the Cloud
start's native call waits for it first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5
@teamleaderleo teamleaderleo added the leo-named-fix An obvious fix to something Leo named: lands on push, review runs in parallel label Nov 4, 2026
@teamleaderleo
teamleaderleo merged commit 339f857 into feat-cmux-next Nov 4, 2026
85 of 102 checks passed
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 6ef05ea: 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=pr34427 -f ref=claude/cloud-start-await-folder-grant -f platform=macos -f backend_mode=local

Gallery before/after for 6ef05ea: 16 states rendered, 0 images differ, 1364 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 41748269322 -R manaflow-ai/cmux -n gallery-advisory-34427-6ef05ea02bac4aa49ad98725f017283b14d977ec (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.composer-rest-gap/gap-40 Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-40 Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-56 Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-56 Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-72 Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-72 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

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

Unclear: web / react-apps-check failed: no known signature; failed step: Check webview test shards. This PR merged before its CI finished: fix forward on main.

CI failed on 6ef05ea02b (run 41748269406 attempt 1): 1 code, 1 unknown.

Job Verdict Why
web / react-apps-base-check (2) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs changes-stage-hunk-keys.test.ts (unnamed): failed (job)
  • seen on other PRs sources-changes.test.ts the summary card lists the turn's changed files and opens each one's diff: failed (job)
Matched log lines
web / react-apps-base-check (2): (fail) (unnamed) [719.86ms]

Not re-run automatically: web / react-apps-base-check (2), web / react-apps-check are not machine failures.

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 3812d4b; does not block
red: web / Web status; a job it gathers is red on this change (its line here); do not merge until green; see lane-rules
red: web / react-apps-base-check (2); NEW webview test reds: test/sources-changes.test.ts > the summary card lists the turn's changed files and opens each one's diff; do not merge until green; see lane-rules
red: web / react-apps-check; a job it gathers is red on this change (its line here); do not merge until green; see lane-rules

Shipped in:

@teamleaderleo
teamleaderleo deleted the claude/cloud-start-await-folder-grant branch November 4, 2026 00:38
@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 4, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 4, 2026

Copy link
Copy Markdown

Found 36 test failures on Blacksmith runners:

Failures

Test View Logs
main.DeveloperIdAppTests.test_download_prints_the_active_profile_only/
test_download_prints_the_active_profile_only
View Logs
stubs: /System/Library/Frameworks/Security.framework/Versions/A/Security has no stub/
Security has no stub
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_CFRetain']/
CoreFoundation, missing 1: ['_CFRetain']
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_log2']/
CoreFoundation, missing 1: ['_log2']
View Logs
test_a_build_host_runs_every_piece_niced_and_capped (main.WebLintPrePushTests.test_
a_build_host_runs_every_piece_niced_and_capped)/
test_a_build_host_runs_every_piece_niced_and_capped (main.WebLintPrePushTests.test_
a_build_host_runs_every_piece_niced_and_capped)
View Logs
test_a_clean_pushed_commit_passes_whatever_the_working_tree_holds (main.WebLintPreP
ushTests.test_a_clean_pushed_commit_passes_whatever_the_working_tree_holds)/
test_a_clean_pushed_commit_passes_whatever_the_working_tree_holds (main.WebLintPreP
ushTests.test_a_clean_pushed_commit_passes_whatever_the_working_tree_holds)
View Logs
test_a_clean_swift_only_push_runs_only_the_pieces_that_read_it (main.WebLintPrePush
Tests.test_a_clean_swift_only_push_runs_only_the_pieces_that_read_it)/
test_a_clean_swift_only_push_runs_only_the_pieces_that_read_it (main.WebLintPrePush
Tests.test_a_clean_swift_only_push_runs_only_the_pieces_that_read_it)
View Logs
test_a_clone_with_no_reviewed_remote_lints_no_check_code (main.WebLintPrePushTests.
test_a_clone_with_no_reviewed_remote_lints_no_check_code)/
test_a_clone_with_no_reviewed_remote_lints_no_check_code (main.WebLintPrePushTests.
test_a_clone_with_no_reviewed_remote_lints_no_check_code)
View Logs
test_a_dry_run_lists_exactly_what_a_run_spawns (main.WebLintPrePushTests.test_a_dry
_run_lists_exactly_what_a_run_spawns)/
test_a_dry_run_lists_exactly_what_a_run_spawns (main.WebLintPrePushTests.test_a_dry
_run_lists_exactly_what_a_run_spawns)
View Logs
test_a_file_in_a_folder_above_a_package_is_check_code (main.WebLintPrePushTests.tes
t_a_file_in_a_folder_above_a_package_is_check_code)/
test_a_file_in_a_folder_above_a_package_is_check_code (main.WebLintPrePushTests.tes
t_a_file_in_a_folder_above_a_package_is_check_code)
View Logs

...and 26 more test failures. View all on Blacksmith

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent claude-opus-5-5 medium): SHIP at 6ef05ea

Visual verdict: unchanged by this diff (no rendering change; it only orders the Cloud start after the folder grant).

Checked: cloudFolderGrant is set by both grant paths (the composer's Run as Cloud pick and newTabProjectPick), and only the cloud.startChat call made through oneCloudStart waits on it. A rejected grant is caught, so the start still goes out. pickFolder never rejects anyway. Home and root folders still ask nothing and hand over no grant, and the new test covers that.

Follow-ups:

  • [follow-up] The wait has no bound. If workspace.useFolder never answers, the Cloud start never goes out, and oneCloudStart keeps waiting set, so the composer stays locked. Race the grant against a short timeout (a few seconds), then send anyway.
  • [follow-up] The ref keeps the last pick's grant. A later folder change made outside these two paths (for example a projectDraft edit with Cloud already picked) is not waited on, so that race is still open there. It is no worse than before this PR.
  • [follow-up] The test covers the newTabProjectPick hand-over only. Nothing tests that the App wiring delays cloud.startChat until the grant settles.

teamleaderleo added a commit that referenced this pull request Nov 4, 2026
…folder's grant (#34592)

Fix-forward of #34427's review follow-up. The Cloud send waited on the last
Cloud pick's workspace.useFolder promise with no time limit, so a grant that
never answered kept the composer locked. Grants are now kept by folder
(cloudFolderGrants), a start waits only for the grant of the folder it sends,
and at most CLOUD_FOLDER_GRANT_WAIT_MS (3 s); past that it sends anyway and
the host's worded refusal (#34406) covers a folder still not granted.


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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 6ef05ea0 Deployed Nov 4, 2026 by teamleaderleo via wait for same-key tree publisher #108260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

leo-named-fix An obvious fix to something Leo named: lands on push, review runs in parallel risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant