cmux link machine update: a tree-mode DEV build pins the build its cmux-tui tree published

Closed
TE
4d ago
+182-23

Leo, 2026-10-31: "whenever i start a chat it should be able to send me to cloud autommatically keep launching/downloading new dev builds and such".

Follow-up to #30258 (and item 3 of #30373). A fleet capture of a DEV build that includes #30258 still failed the first Cloud send with "cloud-chats runs an older cmux that can't take this chat yet", because the update had no build to install:

  • A DEV app bundles cmux-tui built from its own source tree (mode=tree in cmux-tui.version). CI never publishes the DEV app's own commit, so files.cmux.com/cmux-tui/<commit>/manifest.json was a 404. CI publishes the tree instead, under tree/<key>/, from whichever commit first built it.
  • So cmux link machine update answered machine_update_unavailable.

Change (Rust, cmux-remote and cmux link machine update)

  • pinned_linux_payload: when the build's own commit manifest is missing, read key= from the tree-mode cmux-tui.version beside the binary, then:

    • fetch tree/<key>/source.json;
    • check that the key matches and the publishing commit is a 40-hex commit;
    • fetch that commit's manifest and pin the musl build from it;
    • require the tree's own source.json to list the same digest.

    This is the same check RemoteInstaller.plan does for SSH hosts. A release build, a pin-mode bundle, and a dirty or unpublished build behave as before.

  • It now returns PinnedPayload { path, sha256, commit }. machine update treats a machine already on the publishing commit as current (same_tree). Without this, a tree-mode app whose own commit differs from the publishing commit would update the machine on every send.

  • The machine_update_unavailable message no longer says that DEV builds cannot update machines (item 1 of #30373).

Tests

cmux-ci test on the Linux pool:

  • cargo fmt --check: clean.
  • cargo test -p cmux-remote --lib published_pin_tests: 4 passed, including the new a_tree_bundle_takes_its_trees_publishing_commit.
  • cargo clippy -p cmux-remote -p cmux-tui --all-targets -D warnings: clean.
    Agent session: agent session

šŸ¤– Generated with Claude Code