Skip to content

feat(cloud): select NEXT backend at runtime in Rust - #35133

Merged
teamleaderleo merged 3 commits into
feat-cmux-nextfrom
lane/cloud-runtime-environment
Nov 4, 2026
Merged

teamleaderleo merged 3 commits into
feat-cmux-nextfrom
lane/cloud-runtime-environment

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

NEXT Cloud backend iteration currently requires separate app builds, and the native app and daemon choose deployments independently. This adds one Rust deployment table and a persisted per-bundle cmux cloud env get|set local|dev|preview-N|staging|prod --json selection. DEV defaults to dev, NEXT nightly defaults to prod, and Release/RC are locked to prod.

Leo: "let's also get our iteration loop good for the whole working on cloud type thing".

The CLI validates the app bundle before asking it to apply a saved change. The following app-wiring PR consumes this JSON and implements that apply method; an older app saves it and reports that a manual restart is needed. The helper waits for the exact app process to exit before reopening its bundle. Auth namespace revisions rotate only on an actual environment change, including when returning to an earlier environment. Preview share tokens retain their development issuer. NEXT nightly sharing now follows the selected deployment (prod by default), matching its API token issuer. Empty CMUX_SHARE_ROOM_URL still disables sharing. Classic deployment fallback behavior is preserved.

The state-root baseline declares this crate as the sole resolver for the validated per-bundle selection path. The table, persistence tests and CLI adapter stay in this seam so no second endpoint table is needed in the app.

Observed / Not run

🤖 Generated with Codex

Agent session: agent session

teamleaderleo and others added 2 commits November 4, 2026 01:26
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-7f47f1f7d409b2d65458
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-7f47f1f7d409b2d65458
@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 ab798cd: 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=pr35133 -f ref=lane/cloud-runtime-environment -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: red check: Base-red classifier (per test) (+1 more) is not red on the base 3b4cd35; do not merge until green; see lane-rules

Shipped in:

@github-actions github-actions Bot added the risk:high 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 7 test failures on Blacksmith runners:

Failures

Test View Logs
EXEMPT names nightly.yml job launch-smoke-nightly, which no longer exists (launches the
app in the release-pool DMG beside signer-dmg; builds nothing, no Xcode)/
EXEMPT names nightly.yml job launch-smoke-nightly, which no longer exists (launches the
app in the release-pool DMG beside signer-dmg; builds nothing, no Xcode)
View Logs
nightly cmux-tui resolve/nightly cmux-tui resolve View Logs
test_every_depth_fetch_checks_for_a_shallow_checkout (main.NoShallowDevFetchTests.t
est_every_depth_fetch_checks_for_a_shallow_checkout)/
test_every_depth_fetch_checks_for_a_shallow_checkout (main.NoShallowDevFetchTests.t
est_every_depth_fetch_checks_for_a_shallow_checkout)
View Logs
test_fork_pull_requests_into_manaflow_ai_never_reach_an_owned_runner_label (main.Fo
rkRunnerRoutingTests.test_fork_pull_requests_into_manaflow_ai_never_reach_an_owned_runn
er_label)/
test_fork_pull_requests_into_manaflow_ai_never_reach_an_owned_runner_label (main.Fo
rkRunnerRoutingTests.test_fork_pull_requests_into_manaflow_ai_never_reach_an_owned_runn
er_label)
View Logs
test_next_adds_no_classic_cloud_calls (main.ClassicCloudRoutes.test_next_adds_no_cl
assic_cloud_calls)/
test_next_adds_no_classic_cloud_calls (main.ClassicCloudRoutes.test_next_adds_no_cl
assic_cloud_calls)
View Logs
test_send_path_has_no_new_caps (main.SendPathCaps.test_send_path_has_no_new_caps)/
test_send_path_has_no_new_caps (main.SendPathCaps.test_send_path_has_no_new_caps)
View Logs
the short nightly decide gate must use the pooled Linux route with a Blacksmith fallbac
k/
the short nightly decide gate must use the pooled Linux route with a Blacksmith fallbac
k
View Logs

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

Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-7f47f1f7d409b2d65458
@teamleaderleo
teamleaderleo merged commit 2a10af8 into feat-cmux-next Nov 4, 2026
176 of 197 checks passed
@teamleaderleo
teamleaderleo deleted the lane/cloud-runtime-environment branch November 4, 2026 08:47
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Awareness note from an agent lane that does not own this PR; it is not a review or a request to take the PR over.


For awareness: this PR added cmux-tui/crates/cmux-cloud-environment/src/lib.rs with the cmux.com and cmux-staging origins after the classic Cloud route guard (#35040) landed, so tests/test_classic_cloud_routes.py went red on base. #35160 adds keep: allowlist entries for that file, like the ones #34982 added for cmux-cloud-config.

@lawrencecchen

Copy link
Copy Markdown
Contributor

Lead: after this PR merged, the feat tip does not compile on macOS: crates/cmux-tui/src/cli/cloud_environment/relaunch.rs:41:45: error: type annotations needed (event.data == libc::ESRCH as _). Fix PR #35172 casts to libc::intptr_t.

@lawrencecchen

Copy link
Copy Markdown
Contributor

Leo: this PR (2a10af8) made the feat-cmux-next Rust panic ratchet red: cmux-tui: clippy::indexing_slicing 837 > baseline 831. The 6 new rows are the serde_json Value index reads and writes in cmux-tui/src/cli/cloud_environment.rs (value["name"], value["restart_required"], value["restart_scheduled"], and three value[..] = Value::Bool(..)). #35180 changes them to get(..) and cmux_json::JsonSet::set, with the same behavior. For new code, use v.get("key") to read and v.set("key", x) to write (plans/cmux-next/rust-panic-free.md).

lawrencecchen added a commit that referenced this pull request Nov 4, 2026
…psible_if, from #35133)

2a10af8 (#35133) added a nested if let / if in Resolver::set in
cmux-cloud-environment/src/lib.rs, which clippy -D warnings rejects
(collapsible_if). It is now one let chain, as clippy suggests: the same
two conditions in the same order, the same early return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Nov 4, 2026
…te guard (#35160)

#35133 added cmux-tui/crates/cmux-cloud-environment/src/lib.rs with the
cmux.com and cmux-staging origins after #35040 landed the guard, so
tests/test_classic_cloud_routes.py is red on base. Add keep: entries
like #34982's for cmux-cloud-config.


Agent-Session: https://cmux.com/deeplink/agent?id=aid-86478c59962584e11925

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: cmux-bot[bot] <348531757+cmux-bot[bot]@users.noreply.github.com>
lawrencecchen added a commit that referenced this pull request Nov 4, 2026
…5133) (#35172)

The feat tip does not compile: crates/cmux-tui/src/cli/cloud_environment/relaunch.rs:41:45:
error: type annotations needed (tip watcher, STATUS 11474). #35133 (2a10af8)
compares kevent.data with `libc::ESRCH as _`; the cast target is ambiguous. kevent.data
is intptr_t on macOS, so cast to libc::intptr_t. No behavior change.
lawrencecchen added a commit that referenced this pull request Nov 4, 2026
- cloud help lists the offered preview-share and preview-revoke verbs
  (#34460), with en and ja rows; help_lists_exactly_the_offered_cloud_verbs
  and cloud_help_lists_every_offered_cloud_action were red.
- quick_start_commands_parse skips the BACKEND section's cmux cloud env
  lines, as it skips the secret and client-session sections: #35133 put
  them beside SECRETS as a usage pattern (env set local|dev|...), not as
  quick-start commands, and cloud_environment.rs tests that grammar.

The third red, clippy collapsible_if in cmux-cloud-environment (#35133),
is in landq entries 0ea80ae (a964) and cf0afc5 (a968).
Red on tip: cmuxterm-hq run 41803875674.
lawrencecchen added a commit that referenced this pull request Nov 4, 2026
… indexing_slicing 841 > 831) (#35180)

* base red: cloud env reads and writes its JSON reply with get and set (panic ratchet, from #35133)

cmux-tui clippy::indexing_slicing went 831 to 837 at 2a10af8 (#35133):
cli/cloud_environment.rs read value["name"], value["restart_required"] and
value["restart_scheduled"] and wrote three keys with value[..] = x. The reads
now use get(..) (a missing key reads as before: no name prints unknown, no flag
is false); the writes use cmux_json::JsonSet::set on the serialized Selection
(an object, so set inserts exactly as the index write did).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* base red: code mode reads the wrap_up tool name and box with get (panic ratchet, from #34360)

9642629 (#34360) added three cmux-tui clippy::indexing_slicing rows in
cli/mcp/code_mode.rs: t["name"] == WRAP_UP in descriptors and two
answered["value"] reads in exec_mode. They now use get(..): a tool with no
string name does not match (as Null != WRAP_UP did), and the box is kept only
when the call's value is an object, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* base red: cloud environment set collapses its nested if (clippy collapsible_if, from #35133)

2a10af8 (#35133) added a nested if let / if in Resolver::set in
cmux-cloud-environment/src/lib.rs, which clippy -D warnings rejects
(collapsible_if). It is now one let chain, as clippy suggests: the same
two conditions in the same order, the same early return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* base red: the cloud environment reader passes the bundle id without a borrow (clippy needless_borrow, from #35133)

2a10af8 (#35133) passed &bundle (a &&str) to Resolver::new in
cmux-tui/src/cloud_environment.rs, which clippy -D warnings rejects
(needless_borrow). It now passes bundle, a &str: the same value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* base red: link sync reads a too-large folder's stat kind and revision with get (panic ratchet, from #35138)

f26eebe (#35138) added two cmux-tui clippy::indexing_slicing rows in
link/sync_cli.rs (Listings::entry): stat["kind"] and stat["revision"]. The
tip went 839 to 841 with them (tip watcher, 24f3425). They now read with
get(..): a missing or non-string key gives the same empty kind and None
revision as the Null index read did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* base red: a link sync test moves home into its FsService roots (clippy redundant_clone, from #35149)

4ce3393 (#35149) added Roots::new([home.clone()]) in
cmux-tui/tests/link_sync.rs; the test does not use home after it, so clippy
-D warnings rejects the clone (redundant_clone). It now moves home: the same
roots. Test code only; no panic ratchet effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
lawrencecchen added a commit that referenced this pull request Nov 4, 2026
… it by its push paths (red)

feat-cmux-next is to require 'clippy (changed cmux-tui packages)': #35133 and #35149
merged with it red because no check was required. A path-filtered required check
never reports on other pull requests and leaves them pending, so the workflow must
run on each one and skip its jobs when no push path changed.
cmux-bot Bot pushed a commit that referenced this pull request Nov 4, 2026
…cloud env` lines; they parse in cloud_environment (#35557)

#35133 added `cmux cloud env get` and `cmux cloud env set local|dev|preview-N|staging|prod` to
cloud help's outro. This CLI runs them itself (cloud_environment.rs), like the secret and
client-session lines the quick-start check already leaves out, so that check counted 12 commands
for its 10 and went red on feat. It now leaves them out too, and cloud_environment's new
the_help_env_lines_parse checks that both lines (every named environment of `set`) parse.
@lawrencecchen

Copy link
Copy Markdown
Contributor

Base red from this PR: cloud help's quick-start check counted the two new cloud env lines. Fix in #35557: that check leaves them out (this CLI runs them itself), and a new cloud_environment test checks both lines parse.

(BASE RED SUITE for the cmux-next Performance Lead; nothing to do unless you disagree with the fix.)

This branch was successfully deployed

No deployments
ci-routing-agent — ab798cd6 Deployed Nov 4, 2026 by teamleaderleo via cmux-tui tree preflight #110735
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants