cloud: delete NEXT's dead legacy /api/vm link source (−1.8k Swift lines)
M10 of the Cloud architecture plan: delete NEXT's classic /api/vm link source now that nothing selects it. Leo (2026-11-04): "and moving off swift into rust for next's cloud" / "you guys should be willing to remove code rewrite do large scale refactors" / "for next related paths, only look there / simply skip the old code".
Why it is dead
CloudConfiguration.LinkSource.legacy was only the memberwise default. Every real build's configuration (the runtime backend selection, #35284) and the unavailable placeholder pass .appServer, and nothing in Sources sets linkSource anywhere else. The launch-env override the doc comment named is no longer read. The legacy path was reachable only from test fixtures.
What goes
LinkSourceitself. Every app-server branch now runs unconditionally. That touchesCloudService,CloudService+AppServer,CloudStartChat(+Machine),CloudChatPick,CloudPresenter,AgentTabs+Wiring,PageFactory,CloudHandlers+AccountandCloudNetworkAccessActions.- The classic Cloud page:
CloudClassicPageOps.swift, and its feed inCloudPageProviderandCloudAppOps. - The classic network policy:
CloudNetworkPolicy.swiftandCloudNetworkAccessQueue.swift.cloud set-network-accessnow finds the machine and refuses, which it already did on every app-server build. - The classic create:
CloudMachineCreateFlow.legacy,CloudService.createTeamandplanSizes. - Classic routes in
CloudAPIClient: the machine list, record, create, rename, delete, pause, resume and stats routes, plusCloudMachineListandCloudAPIClient+CreateWithKey.swift. - The Codex broker's
/api/vmfallback:CloudCodexBrokerTargetnow always takes its owner answer and liveness check. - Their tests:
CloudClassicPageTestsandCloudLegacyCreateConfirmTestsare deleted. Tests that drove the legacy path through the default now test the app-server behaviour or the shared logic.
Lines removed
Swift under Packages/macOS/CmuxNext, net: −1,784 (Sources −1,202, Tests −844). The string catalog loses another 262 lines of strings only the classic page used.
Stays (on purpose)
- Old-daemon update:
CloudLegacyMachineUpdateupdates daemons that are too old to update in place. It has nothing to do with the link source. - Tunnel/firewall actions: these were never gated on the link source.
- The
cmux-tui remote connectprocess link:CloudMachineLinkandCloudLinkStart. Shared test fixtures build sessions through it, so moving them is its own PR, which comes next.
Austin's #33149 (logging a legacy link's startup steps) becomes moot. I'll leave a note there.
Takes back (on purpose)
- Takes back #27964: deletes the classic create-with-key route; NEXT creates through the app server.
- Takes back #28270: deletes the classic network policy; set-network-access on NEXT already refused on every app-server build.
- Takes back #28405: deletes the classic Cloud page ops, reachable only through the dead
.legacylink source. - Takes back #28407: deletes the classic Cloud page tests with the page.
- Takes back #28518: removes the
LinkSourcebranch in CloudService; the app-server path runs unconditionally. - Takes back #29164: deletes the classic Cloud page tests with the page.
- Takes back #29438: deletes the classic network access queue with the classic network policy.
- Takes back #31666: drops network access tests of the deleted classic policy.
- Takes back #31730: deletes the classic network access queue and its tests.
- Takes back #32866: drops the legacy-create cases; the app-server create keeps its own tests.
- Takes back #36037: removes the
.legacybranches next to its app-server change; its app-server behaviour stays.
Verification
The CmuxNext compile check passes on the fleet at this head. cmux-next swift test runs in CI.
🤖 Generated with Claude Code
Agent session: agent session