Skip to content

cmux-tui: a creator's first chat on their own Cloud machine starts in its work folder with no question - #29556

Merged
teamleaderleo merged 4 commits into
feat-cmux-nextfrom
lane/cloud-owner-first-chat-work-folder
Oct 31, 2026
Merged

teamleaderleo merged 4 commits into
feat-cmux-nextfrom
lane/cloud-owner-first-chat-work-folder

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  1. Folder. A new chat with no folder of the person's own takes the workspace's first terminal folder (remoteFolder). cmux cloud start-session opens 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, so agent-session-start refused it as agent_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).
  2. Trust. The machine's own ~/work would be refused next with agent_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/work reads trusted, with decided and auto: "cloud_work", mirroring how acpmux answers a folder cmux made. This applies at the start and in agent-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 untrusted level.
  • 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 ~/work answers trusted / cloud_work;
    • without the owner word it is refused;
    • a start at $HOME starts, and makes ~/work;
    • another folder still answers untrusted_folder.
  • The person's "Don't trust" on ~/work still refuses.
  • A machine that isn't a Cloud VM still answers home_unconfirmed for 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 Autofix with [code]smith
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 reads trusted with auto: "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 untrusted level 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.

Written for commit e4f1815. Summary will update on new commits.

View guided diff Turn on auto-fix

… its work folder with no question

Leo: "whenever i start a chat it should be able to send me to cloud automatically".

A new chat with no folder of the person's own starts in the workspace's first
terminal folder, which on a fresh Cloud machine is $HOME: agent-session-start
refused it (agent_session.home_unconfirmed, "needs a folder on that machine").
The work folder after it was refused too (agent_session.untrusted_folder):
acpmux's auto-trust is off by default, so the machine's own ~/work asked.

On the caller's own Cloud VM (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 creator):
- an unconfirmed home folder becomes the machine's work folder (made if missing);
- acpmux's trust answer for exactly $HOME/work reads trusted (decided, auto
  cloud_work), at the start and in agent-session-trust's read, so the page asks
  nothing. A person's "Don't trust" and an agent's own untrusted level still win.
Any other folder, a home folder the person chose, and any other machine or
caller keep today's rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 7a7a2ac: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr29556 -f ref=lane/cloud-owner-first-chat-work-folder -f platform=macos -f backend_mode=local

Shipped in:

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 31, 2026
@blacksmith-sh

blacksmith-sh Bot commented Oct 31, 2026

Copy link
Copy Markdown

Found 3 test failures on Blacksmith runners:

Failures

Test View Logs
tab: tabGroup.addTab is not a top-level row/tab: tabGroup.addTab is not a top-level row View Logs
tab: tabGroup.create is not a top-level row/tab: tabGroup.create is not a top-level row View Logs
tab: tabGroup.removeTab is not a top-level row/
tab: tabGroup.removeTab is not a top-level row
View Logs

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

…r an asking agent

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 7a7a2ac

Reviewer: codex gpt-6.1-sol xhigh, fast tier.

Follow-ups: 1. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward.

SHIP at 7a7a2ac
Visual verdict: no images; Leo tries the build

  1. [P2] [follow-up] Return the redirected folder in trust refusals — agent_session_start.rs:296. When ~/work has a saved “Don’t trust” decision, a start at $HOME redirects there and returns untrusted_folder without the effective cwd. The app consequently labels the refusal with the original $HOME (AgentTabs+RemoteStart.swift:98). Its Trust action then fails with home_unconfirmed instead of clearing the work folder’s refusal. Return and consume the effective cwd for this recovery path.

Rust tests were not run: no Rust toolchain is installed.

Follow-ups:

  • Finding 1: Make trust recovery target the redirected ~/work folder.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at e4f1815

Reviewer: codex gpt-6-astra high, fast tier.

SHIP at e4f1815

Visual verdict: no images; Leo tries the build.

No correctness findings.

Follow-ups: none

@teamleaderleo teamleaderleo removed the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 31, 2026
@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 31, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at eaa7f1d

Reviewer: codex gpt-6.1-sol xhigh, fast tier.

SHIP at eaa7f1d

Visual verdict: no images; Leo tries the build

No correctness findings. Focused tests could not run because Rust tooling is unavailable in the review box.

Follow-ups: none

@teamleaderleo teamleaderleo removed the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 31, 2026
@teamleaderleo
teamleaderleo merged commit d3cf70b into feat-cmux-next Oct 31, 2026
165 checks passed
@teamleaderleo
teamleaderleo deleted the lane/cloud-owner-first-chat-work-folder branch October 31, 2026 19:01
@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 31, 2026
austinywang added a commit that referenced this pull request Nov 1, 2026
Keep explicit folder-trust coverage in HOME/project, since the base now
auto-trusts an owner's HOME/work (#29556). Verify the creator can start
a chat on a team machine (#29107), including the machine session and
store binding. Refuse missing owner answers on both plain and team hosts.

Reproduced at 23adfaf via cmux-ci
step 64a6dadbad022f88b748f474:
scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext CloudAgentChatTests,CloudLinkReconnectingTests,PlacementDocumentWriteOrderTests
Cloud chat failed 3/4 due to these stale expectations; reconnect passed
5/5. Placement's pre-operation ordering assertion also fails independently.

Scoped syntax, localization defaults, feature flags and namespace lint
pass. The workspace package-group finding is unchanged base debt.
Exact-head fleet verification follows the normal push; no local builds.
lawrencecchen pushed a commit that referenced this pull request Nov 1, 2026
…agent on the VM (#25680)

* test(next cloud): an ACP chat in a Cloud workspace runs its agent on the machine (#25583)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: frames collector off the main actor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: a reconnected page reattaches to the machine's chat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: the GUI's default first send in a Cloud workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: prove the agent runs with the machine's environment; check the default folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: the machine's HOME is the agent's (acpmux passes no ACPMUX_HOME)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: the Cloud machine's link gives the owner answer a chat start needs (#26323)

Since #26323 the app starts a chat on a Cloud machine only on the Cloud API's
vmKind owner answer of the running link. The stand-in machine now runs a
stand-in link whose attach answer says owner; a new case checks that with no
owner answer no chat starts and the page says why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(next cloud): an ACP chat in a Cloud workspace runs its agent on the machine (#25583)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: frames collector off the main actor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: a reconnected page reattaches to the machine's chat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: the GUI's default first send in a Cloud workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: prove the agent runs with the machine's environment; check the default folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: the machine's HOME is the agent's (acpmux passes no ACPMUX_HOME)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: the Cloud machine's link gives the owner answer a chat start needs (#26323)

Since #26323 the app starts a chat on a Cloud machine only on the Cloud API's
vmKind owner answer of the running link. The stand-in machine now runs a
stand-in link whose attach answer says owner; a new case checks that with no
owner answer no chat starts and the page says why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: the stand-in Cloud machine's daemon gates on the owner word; setup always cleans up

Review fixes for the Cloud ACP chat tests:
- the machine's daemon is told it is a Cloud machine of unknown kind
  (CMUX_AGENT_START_HOST=unknown-cloud), so a start and a trust answer run
  there only with the app's vm_kind owner; the no-owner-link case stays on a
  plain host so only the app can refuse it
- the Cloud workspace's terminal starts in the machine's work folder, and the
  no-folder case checks the chat starts there
- both daemons end with the test process (exitWithProcess), and every launch
  sits inside the cleanup scope; this Mac's acpmux home is shut down too
- waits stop on cancellation; an unreadable acp ls answer is an issue, not an
  empty list; refusal text comes from AgentRemoteStartRefusal
- the stand-in link outlives the 2-minute limit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: isolate Cloud chat sidebar document ownership

CloudAgentChatTests binds AppActions and awaits live daemon work, which changes process-wide SidebarDocStore.current. Hold the existing suite ownership gate so concurrent sidebar suites retain their document. Swift syntax and diff checks pass; focused fleet execution follows on the pushed head.

* test: isolate Cloud chat harness startup

Use private homes for both test machines and disable login-shell import, live catalog fetches and unrelated model probes, matching MachineCatalogAppFixture. Login import and catalog reload precede the first remote-start preflight, whose individual RPCs are bounded at five seconds.

Fleet step 411470d1a2e191624d761bfc on 71e8a84 compiled all test targets, then CloudAgentChatTests failed 2/4 with agent_session.timeout before folder-trust refusal. Reconnect tests passed 5/5 and sidebar placement passed 1/1. The same focused Cloud command will be rerun through cmux-ci on this repair; no assertion or production timeout is changed.

* test: report Cloud chat timeout context

* test: follow current Cloud chat owner and folder rules

Keep explicit folder-trust coverage in HOME/project, since the base now
auto-trusts an owner's HOME/work (#29556). Verify the creator can start
a chat on a team machine (#29107), including the machine session and
store binding. Refuse missing owner answers on both plain and team hosts.

Reproduced at 23adfaf via cmux-ci
step 64a6dadbad022f88b748f474:
scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext CloudAgentChatTests,CloudLinkReconnectingTests,PlacementDocumentWriteOrderTests
Cloud chat failed 3/4 due to these stale expectations; reconnect passed
5/5. Placement's pre-operation ordering assertion also fails independently.

Scoped syntax, localization defaults, feature flags and namespace lint
pass. The workspace package-group finding is unchanged base debt.
Exact-head fleet verification follows the normal push; no local builds.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: cmux-bot[bot] <348531757+cmux-bot[bot]@users.noreply.github.com>
lawrencecchen added a commit that referenced this pull request Nov 1, 2026
…e red) (#30672)

#30363 starts a Cloud chat with no folder in its own ~/chats/<chat id>
and turned the feat base red with two tests, both a test fault, not the
product's:

- acpmux server::remote_guard::cloud_chat_tests::cloud_peer_uses_a_durable_chat_folder
  (added by #30363) gave cloud_chat_folder_under a home folder that did
  not exist. The product makes ~/chats with a non-recursive create
  under the machine's home folder, which always exists there; the test
  now makes its home first.
- cmux-tui::cli agent_session_start::a_first_chat_on_the_callers_own_cloud_vm_starts_in_its_trusted_work_folder
  (#29556) still asked for the old ~/work start. It now checks the
  chat's own folder (renamed ..._starts_in_its_own_trusted_chat_folder),
  and its "Don't trust" case sets that folder untrusted, which still
  wins (owner_cloud_trust keeps a decision).

Red: both fail alone at feat fe81446 (Linux steps d926abca, 9b561165,
04e50fb4; macOS c179ecce). Fix forward instead of the revert #30631:
the product path is right on a real machine, only the tests lacked setup
or asserted the old folder.

This branch was previously deployed

3 inactive deployments
artifacts — eaa7f1db Deployed Oct 31, 2026 by teamleaderleo via add the Windows daemon to the tree #91036
sentry-dsyms — eaa7f1db Deployed Oct 31, 2026 by teamleaderleo via upload cmux-tui dSYMs to Sentry #91036
ci-routing-agent — eaa7f1db Deployed Oct 31, 2026 by teamleaderleo via cmux-tui tree preflight #91036
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant