Skip to content

base red: the app server link's launcher and route move to CmuxNextCloudCredentials (tip arch red from ccb777fdde80) - #32506

Merged
cmux-bot[bot] merged 2 commits into
feat-cmux-nextfrom
base-red/link-route-app-lines
Nov 2, 2026
Merged

cmux-bot[bot] merged 2 commits into
feat-cmux-nextfrom
base-red/link-route-app-lines

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the tip arch red from ccb777f (#32494): [app_lines] CmuxNextApp Swift lines: +8. The last green arch tip is bbb2b89.

Fix forward, with no exception and no change of the ratchet. Behavior does not change. CloudService chose the app server link's launcher in four branches. #32494 added a link_route text to each branch. That code is now CloudAppServerLink in CmuxNextCloudCredentials, next to CloudNativeFirstLauncher. The four branches:

  • not the app server link source: no launcher, legacy
  • choice link: cmux link, link
  • choice native with a Native route holder: CloudNativeFirstLauncher with cmux link as its fallback, and the launcher's own route
  • choice native and no holder: cmux link, link (native asked; no Native route holder for this app)

The Native route holder is still made only for the Native choice of an app server link. A Native fallback is still logged on com.cmuxterm.app.next / app.cloud with the same text.

python3 scripts/cmux-next/arch-ratchet.py --base bbb2b89006be --head HEAD: app_lines -6, no architecture count rises.

Changelog

none

Tests

CloudNativeFirstLauncherTests.theAppServerLinkReportsTheRouteItLaunched is new. It checks the launcher and the route text of each branch, and that the Native holder is not made for the legacy or link choice. It also checks the route after a Native fallback. #32494 had no test of its own.

Observed / Not run

  • Observed: the arch ratchet (above) and prepush-gate.py (no new violations).
  • swift-logic-lines.py rises by 10 (421598 to 421608). A move from one Swift module to another adds the span of the new declaration (CloudAppServerLink). That row was already red on the tip before this PR.
  • Fleet: app compile job 9403465b9d92c270e2db3db4, and the test step d1859fe5c6f97c0b5892cb5e (package-test-lane.sh suite Packages/macOS/CmuxNext with CloudNativeFirstLauncherTests, CloudIdlePauseTests, CloudMachineChangeStateTests, CloudOpenMachineWaitsForLinkTests and CloudMoveTests). A PR comment will give their results.
  • Not run: no live app launch with CMUX_NEXT_CLOUD_NATIVE_LINK=1.

No capture: this change has no UI effect.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Moves the app server link's launcher choice and link_route text into CloudAppServerLink in CmuxNextCloudCredentials, fixing the arch ratchet red from #32494. Behavior is unchanged.

  • CloudService now uses CloudAppServerLink instead of picking the launcher inline.
  • The Native route holder is still created only for the native choice of an app server link, and the fallback log text is identical.
  • Adds CloudNativeFirstLauncherTests.theAppServerLinkReportsTheRouteItLaunched covering every branch's launcher and route text, including after a Native fallback.

Tests

  • Arch ratchet: app_lines -6, no architecture count rises.
  • prepush-gate.py reports no new violations; swift-logic-lines.py rises by 10 from the new declaration's span.

Written for commit 1db30ce. Summary will update on new commits.

View guided diff Turn on auto-fix

…Credentials (fixes the tip arch red from ccb777f)

ccb777f (#32494) added +8 CmuxNextApp lines, which turned the tip
arch-ratchet red ([app_lines] +8 over the last green bbb2b89). Fix forward,
behavior identical: CloudService's choice of the app server link's launcher
(none for the legacy link source, cmux link, or the Native-first launcher with
cmux link as its fallback) and the `link_route` text each choice reports are
CloudAppServerLink in CmuxNextCloudCredentials, next to CloudNativeFirstLauncher.
The Native route holder is still made only for the Native choice of an app
server link, and a Native fallback is still logged on app.cloud.

CloudNativeFirstLauncherTests.theAppServerLinkReportsTheRouteItLaunched covers
each branch: the launcher, the route text, and the route after a fallback.
@lawrencecchen lawrencecchen added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 1db30ce: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr32506 -f ref=base-red/link-route-app-lines -f platform=macos -f backend_mode=local

Shipped in:

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (claude-review-subagent): SHIP at 1db30ce

No concrete defects found. What I checked (static read only, no local build or test):

  1. Equivalence with the four-branch if/else from ccb777f. Each branch gives the same launcher and route: legacy gives nil and legacy; choice .link gives cmux link and link; a Native holder gives CloudNativeFirstLauncher(native:link:onFallback:) and first.route; no holder gives cmux link and the link (native asked; ...) text. Each string matches byte for byte. CloudNativeRouteHolder.forApp still runs only in the Native-choice branch, because the non-escaping native() is called only there. CloudLinkLauncher.forApp(build:relay:) still runs once and always, and before choice(), as it did before. choice() now also runs when the link source is legacy. It only reads LSEnvironment and the process environment, has no side effects and its result is not used there, so the behavior does not change. The fallback log has the same subsystem com.cmuxterm.app.next, category app.cloud and message. The Logger is now made on each fallback, not once, and gives the same output. identity, auth, paths and configuration in the closure are init locals (lines 171, 176, 187), and Self.deviceName is static, so the closure makes no early implicit self access.
  2. Isolation and DI. @MainActor struct: CloudLinkLaunching is a @MainActor, Sendable protocol. The non-Sendable native closure takes on the caller's main-actor isolation, the same as the old synchronous call. Tuple-destructuring assignment to the two lets gives exactly one initialization per path. The tuple-literal elements convert to the contextual (any CloudLinkLaunching)? (nil, CloudLinkLauncher? and CloudNativeFirstLauncher), and { first.route } converts to @MainActor () -> String. Trailing-closure matching goes to onFallback, with choice left at its default.
  3. Test. as? binds tighter than ===, which binds tighter than &&, so x.launcher as? FakeLauncher === link && ... parses as intended. launcher == nil uses the _OptionalNilComparisonType overload. NativeDeviceEnrollmentError has no CustomStringConvertible, so the interpolation and the runtime String(describing: any Error) both print refused(400). The test covers every branch, including "holder not made for .link" (asked == 0) and the route after fallback.
  4. Arch ratchet. python3 scripts/cmux-next/arch-ratchet.py --base bbb2b89006be --head HEAD reports "no architecture count rises", with app_lines -6 (CmuxNextApp -6).
  5. REVIEW.md and namespace convention. The new public struct has an instance surface (launcher, route), so it is not a namespace type. @MainActor is needed because it builds a main-actor launcher. choice is an injected dependency, not a debug-only seam. No new user-facing strings.

Not run: compile and tests. The fleet jobs are the evidence for those.

@blacksmith-sh

blacksmith-sh Bot commented Nov 2, 2026

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
the short nightly decide gate must use the pooled Linux route with a Blacksmith fallbac
k/
the short nightly decide gate must use the pooled Linux route with a Blacksmith fallbac
k
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@cmux-bot
cmux-bot Bot merged commit 280ad5e into feat-cmux-next Nov 2, 2026
185 of 205 checks passed
@cmux-bot
cmux-bot Bot deleted the base-red/link-route-app-lines branch November 2, 2026 18:43
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Fleet results at 1db30ce (the merged head):

  • cmux-ci compile-check --app --package CmuxNext --recipe-version 2 job 9403465b9d92c270e2db3db4: CmuxNext passed, app passed, cmux-tui passed.
  • package-test-lane.sh suite Packages/macOS/CmuxNext step d1859fe5c6f97c0b5892cb5e: all 5 suites passed: CloudNativeFirstLauncherTests (5 tests, theAppServerLinkReportsTheRouteItLaunched included), CloudIdlePauseTests (36), CloudMachineChangeStateTests (34), CloudOpenMachineWaitsForLinkTests (6), CloudMoveTests (15).

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 1db30ced Deployed Nov 2, 2026 by lawrencecchen via cmux-tui tree preflight #102229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant