Skip to content

NEXT: recheck delegated Cloud chat permission before new starts (W2-15) - #30805

Closed
teamleaderleo wants to merge 9 commits into
feat-cmux-nextfrom
w2-15/delegated-chat-start-recheck
Closed

teamleaderleo wants to merge 9 commits into
feat-cmux-nextfrom
w2-15/delegated-chat-start-recheck

Conversation

@teamleaderleo

Copy link
Copy Markdown
Collaborator

W2-15 — fence stale delegated starts on an existing Cloud link

Dependent on backend cmux #30800, which must deploy before this Mac client change lands. Canonical finding: HQ #5353, and W2-15 full result. Draft; no merge/deploy requested.

User failure

Alice grants Bob chat-start permission on a team Cloud VM. Bob attaches: the link stores vmKind: "owner". Alice revokes him. While his original link stays connected, Bob's NEXT app can still initiate a new cmux-managed chat using that stale answer. The existing Rust host gate only sees the answer carried by the old link.

Slice

  • Classic CloudAPIClient.chatStartAccess(id) performs read-only GET of the new backend's /api/vm/:id/chat-start-access (returns the caller's owner | granted | none). It does not mint attach tokens or wake the machine.
  • For a team Cloud VM whose signed-in user is not the recorded machine creator (or creator is unknown), the Mac refreshes that authorization at the new chat start immediately before the remote start connection. A deleted grant, departed member or account switch refuses before a new agent-session-start; an unavailable permission read fails closed. The original Cloud link's generation/owner check remains in place.
  • The creator's own link/start path, SSH hosts, native app-server Cloud links and already-running chats retain their existing behavior. No client-side cached grant is used as authority.
  • Regression tests: stale ownerLink + fresh denied grant sends no start, unreadable permission check sends no start, current grant still permits one start, and API client checks GET path / response without an attach.

Limits / required proof

This closes the ordinary NEXT Mac's post-revoke new-start path only. The grant is still separately checked from the daemon's command admission, so revocation can race a just-authorized command, and CLI/other clients using a previously elevated link need a remote-server-validated, revocable action capability for complete fencing. Do not advertise instantaneous all clients revocation based on this slice alone. Team members also retain their separate shared-VM shell access.

Before review/merge: land/deploy #30800; run exact-head Swift tests (AgentTabRemoteStartTests, CloudMachineShareTests) and an Alice/Bob two-identity runtime probe: grant, Bob attach/start A, Alice revoke, Bob start B without reconnect (must refuse), then Bob reconnect (must refuse), with network-read outage and account switch. Local full Mac test environment unavailable here; CI/runtime evidence still pending.

No other owner's branch was overwritten and no production token, permission, spend or VM change was made.

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 1, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Found 9 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmprx54htgr/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpu9kf_96i/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
nightly must build and hand off the macOS 26 helper and Xcode 26.5 app before publishin
g/
nightly must build and hand off the macOS 26 helper and Xcode 26.5 app before publishin
g
View Logs
test_helper_never_takes_a_hosted_mac_and_skips_compile_on_hit (main.WorkflowTests.t
est_helper_never_takes_a_hosted_mac_and_skips_compile_on_hit)/
test_helper_never_takes_a_hosted_mac_and_skips_compile_on_hit (main.WorkflowTests.t
est_helper_never_takes_a_hosted_mac_and_skips_compile_on_hit)
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.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

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

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 3154610 to compare; do not merge until green; see lane-rules

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Closing: this classic /api/vm work belongs in cmux-platform, not cmux. Continue it there if still needed.

This branch was previously deployed

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