Skip to content

cmux NEXT: agent chat Update button updates the agent CLI in place (cx-1mbnu) - #20569

Merged
teamleaderleo merged 32 commits into
feat-cmux-nextfrom
codex/cx-1mbnu-harness-update-card
Oct 15, 2026
Merged

teamleaderleo merged 32 commits into
feat-cmux-nextfrom
codex/cx-1mbnu-harness-update-card

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Bead: cx-1mbnu

In some agent chats, the "Claude Code 2.1.299 is available (you have 2.1.296)" card's Update button did nothing. The card sent tab.open to run the update in a terminal tab. AgentPaneModel refuses tab.open when a pane has no New Tab page and wasn't built with allowsTabConversion. That covers a chat started from a prewarmed New Tab page (the spare pool, which adopts with allowsTabConversion: false and drops newTab once it becomes a chat) and chats outside a tab (Start Agent panel, onboarding, floating chat). The page dropped the refusal. Other chats opened a terminal tab and ran the update there, which is what the BEFORE recording shows; even then, the chat kept running the old CLI until it was restarted.

Update now runs the update in the chat:

  • The card says "Updating Claude Code…" with a spinner while acpmux runs the agent CLI's own updater on this Mac (_acpmux/harness/update).
  • When it finishes: "Claude Code 2.1.299 is installed. Restart the chat to use it." with Restart Chat.
  • Restart Chat restarts only this chat's agent (_acpmux/sessions/restart_harness with sessions: [this chat]). If a turn is running, the restart waits for the turn to end, and the card says so.
  • Errors show inline in the card with Try Again. If an updater exits 0 but the CLI still reports the old version, that counts as a failure. A restart that fails says so and keeps Restart Chat.
  • The card keeps Restart Chat after the update even if health is read again (on a reconnect, for example) and now reads current. Not Now is disabled while the update runs, so it can't drop the Restart Chat that follows.
  • If the agent service still running is older than the app, the card says to quit and reopen cmux instead of showing "method not found". If the update outlives its 35-minute limit, the card says it may still finish.

Limits:

  • Update and Restart run only for a chat on this Mac and only from a click (the pane's gesture gate). A chat on another machine gets "unsupported".
  • Restart Chat refuses any chat this pane didn't start or show (transport.sessions). Without that check, a page could adopt another chat's id with chat.persistSession and restart that chat's agent.
  • acpmux accepts the new methods only from its local socket, so neither the app's page nor a peer can call them directly.
  • An update that needs sudo still points to Settings > Agents.

Testing

  • Red, then green:
    • acpmux harness_update_runs_named_updaters_now_and_never_one_that_needs_sudo (hosted; red e2a1cf19361c).
    • Web HarnessHealthNotice.test.tsx: red e2a1cf19361c 4 pass / 4 fail (updating, updated then restart, restart held for the turn, failed then Try Again); red 97f6e6138261 7 / 3 (card survives a health re-read, Not Now waits, a failed restart); green at head 10 / 0.
    • acpmux restart_harness_restarts_named_chats_and_reports_one_that_cannot_spawn (hosted; red b380d89e3dfa: a named Home Chief chat was skipped and a failed restart dropped, {"after_turn":0,"restarted":0}; green 0c4c6ea97006). The reply is now {restarted, after_turn, failed, errors: [{session, error}]}, and a Chief chat named in sessions restarts.
    • Swift AgentPaneHarnessCardTests (Restart Chat refuses a chat the pane doesn't show): red d5c51780c082, green 3a25cb81013a.
  • bun run check passed before the review fixes; it runs in CI on the head. test/ui-rules.test.ts passes on the merged head, the crash ratchet is OK, and the god-file check is clean.
  • Base merged at 2834e655ab03 (includes cmux-next: name the owner of ControlWorkspaceInfoCache's publish hop (clears the concurrency red) #20485).
  • Follow-up: cx-1mbnu.1 (a deferred restart can stay pending when the turn lock is held without a turn).
  • Pending at open: hosted Rust red/green receipts, Windows check, Swift compile on the merged head.
  • Before/after recording (Showcase below): cmux NEXT DEV builds on a capture mini, a chat opened with New Agent Chat, Claude Code 2.1.296 in a user-owned npm install.
    • After (93c16bfa95b6, mac fleet build): Update, then "Updating Claude Code…" with a spinner, then "Claude Code 2.1.299 is installed", then Restart Chat. The card goes and the chat answers on the new version.
    • Before (0ea5185b91c0): Update opened a terminal tab next to the chat that ran npm install -g @anthropic-ai/claude-code@latest and installed 2.1.299. This chat came from New Agent Chat, which can open tabs; the "does nothing" case needs a spare-adopted or out-of-tab chat (see above).

Changelog

  • Fixed: The Update button on an agent chat's "new version available" card now updates the agent CLI, then offers to restart the chat on the new version.

Showcase

pr20569 before base

Full quality: pr20569-before-base.mp4

pr20569 after head

Full quality: pr20569-after-head.mp4

Open the live gallery

🤖 Generated with Claude Code

teamleaderleo and others added 2 commits October 14, 2026 03:43
Red: acpmux has no `_acpmux/harness/update`, and the card's Update opens a
terminal tab the chat refuses, so the button does nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e chat (cx-1mbnu)

The "Claude Code X is available" card's Update sent tab.open, which a
normal chat refuses and the page swallowed. Update now runs acpmux's
`_acpmux/harness/update` on this Mac (local chats only, behind a click),
shows progress, then offers Restart Chat (`restart_harness` for this chat,
held until the turn ends). Errors show inline with Try Again. An updater
that exits 0 but leaves the old version is reported as a failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 10:44 — with GitHub Actions Inactive
@cursor

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8db5d73b-df43-43ba-b9a7-b8ff4d945a38

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@blacksmith-sh

This comment has been minimized.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

all web/size checks green

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Not verified: macOS jobs did not run: compile and app tests were skipped on d8850f6ae4; ci-status is green without them.

CI passes on d8850f6ae4 (run 38662530913 attempt 1).
macOS jobs did not run: compile and app tests were skipped: Fast static checks skipped (the macos job needs both to succeed). Re-run CI once they pass, before merging.

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.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

CI fast guards passes on d8850f6ae4 (https://github.com/manaflow-ai/cmux/actions/runs/38662530913). This covers only the fast guards, not CI: CI's result is the ci-status check, and the CI failure attribution comment names any failing test.

teamleaderleo and others added 2 commits October 14, 2026 04:02
Red: a page that adopts another chat's id with chat.persistSession can
restart that chat's agent.

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

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 11:02 — with GitHub Actions Inactive
teamleaderleo and others added 3 commits October 14, 2026 04:07
…tart (cx-1mbnu)

Red: a reconnect that reads health again after the update hides the
Restart Chat card, Not Now can drop it mid-update, and a restart that
failed reads as done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and names old or slow agent services (cx-1mbnu)

The card holds an update it started even once health reads current, Not
Now waits for the update, a restart acpmux reports as failed shows its
error with Restart Chat kept, and an agent service older than the app or
an update past its deadline say so instead of "not running".

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

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 11:15 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

cmux-next tour of ba0d0ba9d6f58398afa736fa755f5752aee922c1 (run)

The tour job failed before the tour ran (build or setup); the run log has the output.

The tour produced no media.

Tours are data in scripts/cmux-next/media/tours: add a step or a tour file to show your feature.

teamleaderleo and others added 2 commits October 14, 2026 05:35
… a named Chief chat (cx-1mbnu)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_acpmux/sessions/restart_harness counted a failed restart in neither bucket,
so the reply read as success. It now returns failed and errors
[{session, error}], and a Home Chief chat named in sessions restarts; only
an unnamed sweep skips the Chief.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 12:35 — with GitHub Actions Inactive
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 12:53 — with GitHub Actions Inactive
… pane strings (cx-1mbnu)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 12:54 — with GitHub Actions Inactive
- vp fmt webviews/test/ime-composition-keys.test.ts
- vp fmt webviews/test/new-tab-omnibar-pointer.test.ts
- cargo fmt in Native/OptChat/optchat-chief

Autofix-Run: https://github.com/manaflow-ai/cmux/actions/runs/38567413643
…-1mbnu-harness-update-card

# Conflicts:
#	cmux-tui/crates/acpmux/tests/harness_health.rs
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 20:49 — with GitHub Actions Inactive
- vp fmt webviews/src/pages/home-channels/HomeChannelsPage.tsx

Autofix-Run: https://github.com/manaflow-ai/cmux/actions/runs/38635266431
@blacksmith-sh

This comment has been minimized.

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 22:55 — with GitHub Actions Inactive
- vp fmt webviews/src/pages/home-channels/cloudHome.ts
- cargo fmt in Native/OptChat/optchat-chief

Autofix-Run: https://github.com/manaflow-ai/cmux/actions/runs/38650813603
@teamleaderleo

teamleaderleo commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

Visual preview of d8850f6: in the maintainers' private review feed.

@blacksmith-sh

This comment has been minimized.

@cursor

cursor Bot commented Oct 15, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Merge receipt for head d8850f6: fleet Release compile green (BUILD SUCCEEDED); hosted Rust verify green (run 38662530945: lint, tests on Linux and macOS, _named_ tests); build x86_64-pc-windows-gnu green; cmux-next fast tier, cmux-next checks, size cap, crash ratchet and web/react-apps-check green. Remaining reds are waived kinds: 'action export areas' (bot job cancelled at checkout) and the cancelled report-only gallery renders. The pub use route_switch::HarnessRestarts; re-export is back now that #20686 split hub/mod.rs.

@teamleaderleo
teamleaderleo merged commit b9432a5 into feat-cmux-next Oct 15, 2026
200 of 219 checks passed
@teamleaderleo
teamleaderleo deleted the codex/cx-1mbnu-harness-update-card branch October 15, 2026 03:56
teamleaderleo added a commit that referenced this pull request Oct 15, 2026
…rt (cx-1mbnu)

restart_harness now answers {restarted, after_turn, failed, errors} (#20569).
The apply passes the count on as threads_failed and the first reason as
threads_error, so Update Everything can say which chats still run the old
agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lawrencecchen added a commit that referenced this pull request Oct 15, 2026
…the protocol registry; pane policy test reads typedRequest (cx-js8uc)

protocol_registry_names_every_served_method was red on every OS:
_acpmux/harness/update and _acpmux/sessions/restart_harness (#20569,
cx-1mbnu) and now _acpmux/btw (#20847) were served but not declared.
Declare them (untyped, Request), refresh spec/acpmux-protocol.json and the
generated web methods, and document update/restart_harness in
docs/acpmux-schema.json.

the_allowlist_is_what_the_page_sends was red since #20576: direct.ts sends
_acpmux/permission_respond through typedRequest(send, "...", ...), which the
test's this.request( scan missed. The test now also reads the literal method
of each typedRequest call. policy.json is unchanged: the page still sends
permission_respond, and the page never sends the harness methods itself
(the Swift host calls them over the unix socket, gesture-gated; acpmux
refuses them for LocalApp, Web and peer).

Remove both cx-js8uc rows from scripts/ci/cmux-tui-base-red.tsv.
teamleaderleo added a commit that referenced this pull request Oct 15, 2026
…ues its chats (cx-1mbnu) (#20920)

* cmux-tui: Update Everything journeys, before the fix (cx-1mbnu)

Behavior tests for agent-update-v1 (plan and apply over a headless daemon
with acpmux and a fake vendor CLI), _acpmux/harness/update (runs named
updaters now, never one that needs sudo) and cmux link machine update
--to-bundled. They fail on this commit: the commands do not exist yet.

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

* cmux-tui: agent-update-v1 updates a machine's agent CLIs and continues its threads (cx-1mbnu)

- acpmux _acpmux/harness/update {ids?}: unix-socket only; runs each named
  outdated harness's own update plan now (ignoring the auto-update opt-in,
  keeping the no-sudo rule), deduplicated and serialized with auto-update,
  and answers per-harness results after a fresh check.
- acpmux _acpmux/sessions/restart_harness {harnesses?}: restarts local,
  non-Chief chats on the new CLI with resume and no route binding; idle
  chats now, chats in a turn when the turn ends.
- cmux-tui-core agent-update-plan / agent-update-apply (capability
  agent-update-v1, trusted unix clients only, never through the relay):
  the machine's outdated CLIs and thread counts, then the update and the
  restarts. An acpmux of another build is handed off first
  (shutdown --keep-agents, then the daemon's usual start).
- cmux link machine update --to-bundled: update whenever the machine's
  build differs from this binary's.

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

* cmux-tui: agent-update review fixes (cx-1mbnu)

- Hand acpmux off only when it answers method-not-found (-32601) for
  _acpmux/harness/update (new LinkError::MethodNotFound); a running acpmux
  of another build that knows the method is used as is (never a downgrade).
  The handoff runs under the acpmux start lock, connects once even when the
  restart failed, and an acpmux that still lacks the method is
  agent_update.acpmux_unavailable.
- The handoff runs the installed binary (a Linux " (deleted)" image path is
  resolved to the installed file, or refused with a clear error).
- A failed thread restart keeps the update results and reports
  threads_error (spec documented).
- The update call's timeout scales with the ids (15 min each + margin,
  capped at 2 h).
- agent_update moves under agent_transfer and its state into
  AgentTransfers, so mux.rs, server.rs and main.rs do not grow (Rust
  god-file check).
- --to-bundled notes that two apps sharing a machine each move it to their
  own build.
- Journeys: a WebSocket client is agent_update.not_trusted; a second apply
  while one runs is agent_update.busy.

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

* cmux-tui: agent-update-apply reports the chats acpmux could not restart (cx-1mbnu)

restart_harness now answers {restarted, after_turn, failed, errors} (#20569).
The apply passes the count on as threads_failed and the first reason as
threads_error, so Update Everything can say which chats still run the old
agent.

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

* cmux-tui: the busy journey fails fast when no updater starts (cx-1mbnu)

Its read of the updater's FIFO blocked for good when nothing wrote it, so
on a daemon without the verb the job hung until cancelled.

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

* cmux-tui: --to-bundled reads the build identity from cmux-build-identity (cx-1mbnu)

Base moved BUILD_IDENTITY out of cmux_remote::ssh_bootstrap into the leaf
crate (bf5875d); machine_update.rs still named the old path.

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

* chore(next): PR autofix at 83be20e

- regenerated schemas/defaults/cmux-next.json

Autofix-Run: https://github.com/manaflow-ai/cmux/actions/runs/38699631019

* cmux-tui: base's acpmux prompt and withdraw read MethodNotFound as before (cx-1mbnu)

agent-update split JSON-RPC method-not-found out of LinkError::Rpc, and
base's agent_message_acpmux.rs matched LinkError exhaustively without it.
A prompt fails with its message and a withdraw reads it as an error
without data, which is what both did when it arrived as Rpc.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: cmux-autofix[bot] <cmux-autofix[bot]@users.noreply.github.com>

This branch was previously deployed

2 inactive deployments
artifacts — d8850f6a Deployed Oct 15, 2026 by teamleaderleo via publish tree-addressed cmux-tui #15594
cmux-tui-merge-tree — d8850f6a Deployed Oct 15, 2026 by teamleaderleo via publish the merge tree #1122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant