Cloud relay chat: the machine's typed error reaches the app's answer and cloud start-chat

Merged
TE
21h ago
+78-6

Lands after #36828, whose relay produces these fields; this head is rebased onto it before review.

Leo, 2026-11-05: "I thought we had better typed errors than this. I thought we had a better solution than whatever was going on here."

#36828 makes the machine's relay send acpmux's typed error up: detail (daemon_closed, trust_required), a closed daemon's cause (panicked, socket_left, ...), error_kind (auth.signed_out), retryable and recovery. The platform's MachineRelay forwards the event whole, but the app's CloudRelayChat.Answer kept only code and message, so the types stopped at the Mac. That is #36828's review follow-up F1.

Now CloudRelayChat.Answer reads them, and CloudStartSession.relayFields returns them as error_detail, error_cause, error_kind, error_recovery and error_retryable. cmux cloud start-chat puts them under details.error in both relay failure paths. An older machine sends none of them, and nothing is made up. The field map lives in CmuxNextCloud, so CmuxNextApp gains no lines.

Changelog

Fixed: a Cloud chat that fails on its machine shows why (a closed daemon and its cause, an auth kind, what to do) in the app's answer and in cmux cloud start-chat --json.

Tests

The regressions are in their own commit, ahead of the fix; they use new API, so their red is a compile failure:

  • CloudRelayChatTests.anErrorKeepsItsTypeFromTheMachine: every field read, and wrong-typed values ignored.
  • cargo test -p cmux-tui --lib cloud_start_chat: typed_error carries the app's fields and makes up none.

Observed / Not run

  • Mac suite on fleet Macs (scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext CloudRelayChatTests): red at 55985af0 (step 7ff00cfdcd0bb3ca150ef255) fails to compile, Answer has no member errorRetryable; green at 707f76f9 (step c51a4b6ba8f2c98cec8c286b): 6 tests pass.
  • cargo test -p cmux-tui --lib cloud_start_chat: 37/37. App compile check: passed.
  • Not run: a live relay failure end to end on a Cloud machine.

šŸ¤– Generated with Claude Code

Agent session: agent session