cmux-tui: start-chat plan answers the folder's repo; start-chat ensure gets the workspace machine
Merged
TE
4d ago+448+448+012345678901234567890123456789-9-9-0123456789
Summary
Client half of zero-setup hot start (cmuxterm-hq#5846, item 2): the first Cloud send of a chat gets a workspace machine that boots from the repository's set-up snapshot once it is ready.
cmux link start-chat planreads the chat folder's GitHuboriginremote (a new optionallocalfield in the request) and answersrepo(owner/name, or null). It also echoesenvironment, the cloud environmentcloud.startChatchose (an optionalenv_...that the environment sheet sets, #30359).- New
cmux link start-chat ensure --workspace W --key K --repo OWNER/NAME [--ref R] [--environment env_...] [--platform URL], with the cmux credential on stdin. It sendsPOST /v1/workspaces/{W}/machineto the cmux platform, with the plan'screate_keyasclientKey(a retry gets the same machine), plusrepo,refandenvironment. It prints one JSON line:{"ok":true,"machine","team","created","snapshot","environment":{"id","status"}}, or the platform's error code (for examplecloud_environment.not_found). cli/machine_join.rsshares its platform client (Platform,platform_origin,CallError) with the link module, gains apostcall, and lists the workspace-machine error codes as known codes.
The App still makes machines via cloud.createMachine. A follow-up wires CloudStartChat+Machine.swift to call ensure when the plan has a repo. That needs CloudMoveCLI to pass the token on stdin, as AddDeviceServices does.
Testing
- New tests in
link/start_chat_cli/tests.rs: parsing GitHub remote URLs,planagainst a real git folder (no origin ā null, then an scp-style origin), theensureflags and body, and how platform answers and errors map to its line. cmux-ci test -- cargo test -p cmux-tui start_chat(result in a comment below).
Observed / Not run
- Not run yet: the end-to-end send from a DEV build (it waits on the Swift wiring).
Changelog
none
š¤ Generated with Claude Code
Agent session: agent session