cmux-cloud-client: CI fails a new hand-written call to a route the generated client offers

Merged
TE
1d ago
+164-0

Leo, 2026-11-05, after a Cloud chat failed on a hand-spelled field name: "You guys keep running into these. These are weird issues that I feel like you should be able to just fix beforehand and check on beforehand."

#36041 made cmux-cloud-client cmux-tui's one client, generated from cmux-platform's openapi.json. A call to the same route written by hand elsewhere can still drift from the spec unnoticed. This test makes CI fail when a new one appears.

What changes

  • cmux-cloud-client/tests/hand_written_routes.rs looks for "/v1/..." literals across cmux-tui's crates that name a route in the vendored openapi.json. Both sides' path placeholders are matched, and comments and tests are skipped.
  • hand-written-routes.txt lists the 17 that predate the client, and the list can only shrink:
    • acpmux cloud_rewind and vault/wire
    • cmux-host and cmux-server auth challenge/token
    • cloud-conversations environments
    • machine_join credentials, join-tokens and vault
    • link/start_chat_cli workspace machine and reservations
  • A new literal fails with "call it through the client". A listed one that is gone fails until it is removed from the list.
  • Routes the vendored spec does not describe, such as /v1/artifacts* and the cmux.wire/1 ops, are out of scope until they are added to tags.txt.

Changelog

none

Verification

cargo test -p cmux-cloud-client --test hand_written_routes passed on fleet Linux at this head: 2 tests.

Agent session: agent session

🤖 Generated with Claude Code


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


Summary by cubic

Fails CI when a new hand-written call names a route cmux-cloud-client already generates from the vendored openapi.json, so route drift is caught before a Cloud call fails.

  • A new test scans cmux-tui's crates for "/v1/..." literals that match a route in the spec, ignoring comments and tests.
  • The 17 pre-existing literals live in hand-written-routes.txt, which can only shrink: a new one fails, and a listed one that disappears fails until removed from the list.
  • Routes the spec does not describe, such as /v1/artifacts* and cmux.wire/1 ops, are out of scope until added to tags.txt.