mux: Cmd+1 orchestrator, slice 1 (chat, DO brain, memory, code mode, link)

Draft
LA
6d ago
+11084-61

Summary

mux is the Cmd+1 orchestrator for cmux next: Messages-style conversations between humans and mux agents. Slice 1 works end to end on staging (https://mux-staging.debussy.workers.dev):

  • Sign in with a cmux account (Stack, email and password; dev project for now).
  • Chat with your mux. Its brain runs in a Durable Object on coderouter (gpt-6.1-sol, high, priority) and keeps working when no Mac is online.
  • Memory is OptMem-style: one append-only log of everything the mux sees, a wake view within 96 lines, and lazy compaction (levels 1 to 3 on gpt-6-luna). It is stored as a git repo per mux on the account's Freestyle memory VM, behind a SQLite cache.
  • Code mode: the single run tool executes model-written JS in a Dynamic Worker with no network. Its only capability is the typed mux API: machines, agents, memory.
  • mux-link (Rust) connects a Mac outbound and lets the mux spawn and steer acpmux agents there. Turn endings come back as events, and the mux reports them in the conversation.

Design and decisions: mux/DESIGN.md; progress log: mux/PROGRESS.md. mux/cloud/ is BSL (license PR: https://github.com/manaflow-ai/cmux/pull/16277); the rest of mux/ is GPL and never imports from cloud/.

Home (cmux next) and the local form

  • cmux next's sidebar has a pinned Home row under the titlebar with a hairline below; the workspace list scrolls under it. Cmd+1 shows Home, Cmd+2…8 select workspaces 1…7, Cmd+9 the last; home.show covers palette, menu and CLI (home show). The workspace under Home stays mounted.
  • Home loads the local form by default: mux/local, a Bun server on 127.0.0.1:47820 with no sign-in. Each conversation's mux is an acpmux session (claude); chats are SQLite and memory a git log under ~/.cmux/mux. The server refuses foreign Origins and non-loopback Hosts. When it is not running, Home shows the start command and Retry. CMUX_NEXT_MUX_URL points Home at staging instead.
  • Memory VMs for the cloud form boot from a baked BusyBox + git snapshot (1 vCPU / 128 MiB / 1 GB).

Testing

  • vp check, vp run -r test (23 tests: protocol, brain turn loop, SSE parser with a recorded coderouter stream, code-mode sandbox, memory cover/compaction/cache, web store reducer) and vp run -r build pass in mux/.
  • Live on cf dev and on staging: Stack sign-in in headless Chromium (apps/web/scripts/e2e.ts); code mode in production Dynamic Workers; a mux spawned a Claude agent on this Mac through mux-link, the agent wrote the requested file, and the mux reported it done; memory recalled a fact across conversations from the git repo on the memory VM.
  • Not covered: OAuth sign-in, multiple humans in one conversation, the Codex harness (broken in acpmux on this Mac, also from its own CLI).

Changelog

none

šŸ¤– Generated with Claude Code