Cloud: the machine record says desktop, and the app offers its rd viewer

Merged
TE
1d ago
+147-5

The desktop-agent-production probe (hq run 42112615671 at 8e84a179) got through the guest's automated click in 20 s. Then open-desktop was refused: "machine capabilities lack desktop; machine-status reports none". Take-over and hand-back were never reached.

Cause

A NEXT machine whose daemon advertises link-desktop-v1 had no way to tell the app. CloudMachine(next:) maps capabilities only from provider_operations, and the cmux-next record never sends that field. So capabilities.desktop stayed false, allows(.desktop) refused, and the default viewer fell back to web.

There was a second gap in the image. The bake behind cloud-native-cbbeec1-rd021 pins cmux-tui cbbeec18, which predates #36519 (with_desktop in cmux-host role.rs). That guest never reported link-desktop-v1. The current lock (cmux-tui 8c00572a) includes #36519, and a bake from it is running.

Change

  • Protocol: CloudMachine.desktop (optional boolean). It is true when the machine serves link service desktop. The catalog, TS client, Rust wire types and app .d.ts are regenerated (catalog:check passes).
  • Cloud app server (Rust relay): Machine.desktop is relayed, and only when it is true.
  • App: CloudMachine(next:) reads desktop into servesDesktop. That turns on capabilities.desktop and allows(.desktop) without declaring any other operation, so defaultDesktopViewer becomes rd. A record without the field reads as before.

The platform side, which sets desktop from machineServesDesktop, is manaflow-ai/cmux-platform#903.

Tests

These fixture tests do not need Claude auth:

  • CloudMachineCapabilityTests, 3 new cases:
    • a record with desktop: true gets the rd viewer and leaves other actions undeclared;
    • an absent or false desktop keeps web;
    • declared provider_operations gain desktop.
  • first-party-apps/cloud/server machine_desktop_relays_to_the_app: true round-trips, while absent or false is omitted.
  • The guest side is already covered by the_desktop_capability_follows_the_images_socket_unit (role_tests.rs).

Changelog

  • Cloud: Open Desktop shows the video stream viewer on a Cloud machine whose image serves its desktop.

🤖 Generated with Claude Code

Agent session: agent session


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


Summary by cubic

Cloud: the machine record says desktop, and the app offers its rd viewer

A NEXT Cloud machine whose daemon advertises link-desktop-v1 had no way to tell the app: the cmux-next record carries no provider_operations, so capabilities.desktop stayed false and open-desktop refused the rd viewer. This adds an optional desktop boolean to the CloudMachine protocol, relays it through the Cloud app server, and maps it to capabilities.desktop on the app side—without declaring any other operation.

  • A record with desktop: true offers the rd viewer, and only to its creator (the link token refuses a teammate); a different user, or a record that is absent or false, keeps web.
  • The field is relayed only when true, so older records and backends read as before.
  • Regenerated catalog, TS client, Rust wire types, and app .d.ts; fixture tests cover the app decoding and server relay.

Platform-side update that sets desktop from machineServesDesktop lives in manaflow-ai/cmux-platform#903.