agent pane: a no-project chat is trusted from its first frame, not after a settings read

Merged
TE
1d ago
+118-2

Leo, 2026-11-03, beside the "This pane is still opening; try again in a moment." toast:

and this is extremely bad. i should be able to just close immedeiately.
and why does it even take time to read settings? you know what things are. the read defaults/the "not working in a project" thing that should all be instant

The close half is already fixed on base (#34367, #34530). This PR takes one piece of the second half: a chat in no project ("Do not work in a project") runs in its workspace's agent-home folder, which acpmux always trusts (trust.rs, made_by_cmux). The pane still drew no trust answer for that folder until acp.trust.get came back. That read opens and parses the agents' settings files (~/.claude.json, ~/.codex/config.toml) and checks git, with a 1.5 s timeout (TRUST_READ_TIMEOUT_MS). The folder is new for every workspace, so the pane's trust cache never had it. Until the read answered, the chat was not shown as trusted, and prompts held behind trust waited (trustHeldWaits).

What changes:

  • folderTrust.ts adds agentHomeTrust(cwd), which returns acpmux's own answer ({level: "trusted", decided: true}) for a direct child of ~/Library/Application Support/cmux/agent-home. It returns nothing for a folder inside one, for the root itself, or for a look-alike path.
  • useFolderTrustAsk uses that answer on the first frame, but only for a chat whose folder is on this computer and that has nothing cached for it. The read still runs and replaces it. acpmux's trust gate is still the authority, so a refusal reads the folder again as before.

Test: newtab/agentHomeTrust.test.tsx covers three cases, all with a read that never answers. An agent-home chat is trusted with no block on every frame, and the read is still made. Any other unread folder still waits. A remote chat at the same path, or a subfolder, gets no seed.

Not changed here (findings, for follow-ups):

  • The New Tab folder chip keeps its place unlabelled for up to RESERVE_MS (2 s) when the tab has no folder and acpmux has not listed chats yet (NewTabScreen.tsx projectPending). This is deliberate (Leo 2026-10-19: no "Choose folder" then flip).
  • The access chip draws PendingMode until _acpmux/start_mode or the session's modes answer. The model catalog and the cmux.json agentPane.models arrive with models.catalog, not the handshake.

Risk: small. A webview first-frame seed for one folder class, with acpmux's gate unchanged.

Leo-ask: ask-fa845ab0fd

🤖 Generated with Claude Code

Agent session: agent session


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


Summary by cubic

Shows a no-project chat as trusted on the first frame instead of waiting for a settings-file read, so prompts no longer hold behind trust while acp.trust.get runs.

  • folderTrust.ts adds agentHomeTrust(cwd), which returns acpmux's trusted answer for a direct child of ~/Library/Application Support/cmux/agent-home.
  • useFolderTrustAsk seeds that answer on the first frame for local chats with nothing cached; the read still runs and replaces it, and acpmux's trust gate remains the authority.
  • A remote chat at the same path, a subfolder, or any other unread folder still waits on the read.