cmux-tui: a creator's first chat on their own Cloud machine starts in its work folder with no question
Leo: "whenever i start a chat it should be able to send me to cloud automatically".
What was wrong
Once #29107 and #29497 got a fresh Cloud machine past the team gate, the creator's first chat was still refused, in two steps.
- Folder. A new chat with no folder of the person's own takes the workspace's first terminal folder (
remoteFolder).cmux cloud start-sessionopens a terminal on the machine first, and a first send in a machine workspace uses the same terminal folder. On a fresh machine that terminal sits in$HOME, soagent-session-startrefused it asagent_session.home_unconfirmed. The app reads that code as "needs a folder on that machine to start in". The nightly signed-in capture showed this on a fresh machine (hq run 41224623701). - Trust. The machine's own
~/workwould be refused next withagent_session.untrusted_folder. acpmux's auto-trust is off by default (agents.trust.autoTrust), so nothing trusts it. Leo's VM reached this step after the owner gate.
Neither step depends on the image: every image puts a fresh terminal in $HOME.
What changes
The changes are in cmux-tui (Rust), and they ship to machines through the app's own update of the machine's cmux-tui (#29497).
They apply only on the caller's own Cloud VM. That means the machine kind gate reads a Cloud VM (a team VM included) and the caller's vm_kind is exactly owner, the Cloud API's answer for the machine's creator.
agent-session-start: a start in an unconfirmed home folder starts in the machine's work folder instead ($HOME/work, made if missing).- Trust: acpmux's trust answer for exactly
$HOME/workreadstrusted, withdecidedandauto: "cloud_work", mirroring how acpmux answers a folder cmux made. This applies at the start and inagent-session-trust's read, so the app's page asks nothing either. - What still wins: the person's "Don't trust" (an acpmux decision) and an agent's own
untrustedlevel. - Unchanged: any other folder on that machine, a home folder the person chose (Use Home Folder), any machine that isn't a Cloud VM, and any caller without the owner word.
Tests
a_first_chat_on_the_callers_own_cloud_vm_starts_in_its_trusted_work_folder (cmux-tui tests/cli/agent_session_start.rs):
- On an owner VM, and on a team VM with the creator's word:
- the trust read for
~/workanswerstrusted/cloud_work; - without the owner word it is refused;
- a start at
$HOMEstarts, and makes~/work; - another folder still answers
untrusted_folder.
- the trust read for
- The person's "Don't trust" on
~/workstill refuses. - A machine that isn't a Cloud VM still answers
home_unconfirmedfor its home.
Risk
This decides folder trust for one folder on one kind of machine: the work folder of the caller's own Cloud VM, which is a disposable sandbox the person owns. The daemon already lets any agent family run there (#28613). It records nothing in acpmux; the person's own answers still override it.
Agent session: agent session
š¤ Generated with Claude Code
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes a creator's first chat on their own Cloud VM so it starts in the machine's work folder with no trust question.
On a fresh Cloud machine, a new chat with no folder of the person's own starts in the workspace's first terminal folder ($HOME), which agent-session-start refused as agent_session.home_unconfirmed; the machine's own ~/work was refused next as agent_session.untrusted_folder because acpmux's auto-trust is off by default.
Changes
- On the caller's own Cloud VM, an unconfirmed home folder becomes
$HOME/work, made if missing, and that folder readstrustedwithauto: "cloud_work"at start and in the trust page, so no question is asked. - On a team VM, a start passes the folder and its trust, then asks for an agent that asks before acting (
agent_session.not_asking). - A person's "Don't trust" and an agent's own
untrustedlevel still win. - Any other folder, a home folder the person chose, any non-Cloud VM, and callers without the owner word keep today's rules.