cmux-api: no Cloud code; cloud-env leaves cmux

Merged
TE
1d ago
+163-15975

Leo, 2026-11-04: "like there's the client, and then there's our cmux-platform repo. we can move a lot there." and "you guys should be willing to remove code rewrite do large scale refactors".

cmux-platform: NEXT Cloud's backend (CloudDO, drivers, routes, cloud-env) is cmux-platform's; this deletes cmux-api's copies. Companion: manaflow-ai/cmux-platform#833 (direct routes for the Cloud paths, cloud-env owned there).

What changes:

  • CLOUD_DO already names cmux-platform-'s class in every environment, and the Cloud paths and cloud:CloudDO ops already forward there (PLATFORM_SURFACES=cloud). The local copies served nothing.
  • New src/platform-cloud.ts: a typed client of the platform CloudDO's RPCs that this Worker calls (submit, readOp, mintLinkToken, vmOp, automationExec, clearAbandoned). Callers: op routing (http.ts), automations, the default Chief hand, the GitHub token gate and the operator clear.
  • Deleted: CloudDO and its domain (cloud-do*.ts, domains/cloud*.ts), the direct and VM API drivers, PlatformMachines, the Cloud route handlers (bind, keyset, acpmux, client session, guest, trajectories), the Freestyle Cloud provider, the Cloud tests, and backend/packages/cloud-env. platform-forward.ts keeps its path list inline. Without the PLATFORM binding, a Cloud machine path answers a retryable 503 instead of a local handler.
  • Tests that touched CloudDO on the side (tenant isolation, SSO, hand-offs, GitHub token, automations, Chief wake) keep their non-Cloud cases. Their Cloud cases are CloudDO's, so they are tested where CloudDO lives.
  • wrangler.jsonc: the top-level (local) block drops its own CLOUD_DO binding, and no migration deletes the old local CloudDO namespace: src/cloud-do-retired.ts exports an inert CloudDO (410 on any call) so its pre-cutover rows stay and no production DO approval is needed. Without a CLOUD_DO binding (the local env) every Cloud op answers a retryable owner.unreachable.

The Cloud ops on /v1/ops and /v1/read stay on the forwarder, since an op is chosen by its body.

Checks (fleet, at this head's tree): tsc clean; API Worker tests 199 files and 1226 tests passed; Node tests passed; catalog:check, lint:size and the guest command check passed; wrangler deploy --env production --dry-run passed. The headless journey runs after the deploy.

Lines: 115 added, 15,957 deleted.

Agent session: agent session

šŸ¤– Generated with Claude Code