ai-env: let new chats choose the environment automatically

Closed
TE
8d ago
+733-62

HOLD: Waiting for the webview base test gate to recover; independent review and focused verification continue.

New chats use Auto in the existing preview environment picker. The clickable scope line shows the destination as the prompt changes, such as Auto · This Mac or Auto · Cloud machine; the existing explicit machine, saved-environment and sandbox choices remain available.

Auto preserves the project's owning machine. Changing destination requires an affirmative execution request naming a complete machine name or asking for cloud/remote execution; ordinary coding prompts and negated requests stay local. Equal paths on different machines do not establish project ownership. It only chooses currently listed, available peers. A remote launch uses a folder known on that destination; the preview shows that same folder. With preview features off, routing stays on the displayed local machine.

Requested notes:

"why doesn't ai just choose what environment i want"
"AI just choose the environment"
"Chatgpt work don't have to think about environments"
"Environment choose cloud that would be nice"

The compact scope row follows the Claude Code composer/environment reference, retaining cmux's colors, glass and immediate menu opening. Gallery variants cover local, cloud and named-machine choices; the selected presentation keeps the actual destination beside Auto.

Validation at b57ee16527d7b941f95b8ea7d60784683457139c: managed full webview lint comparison and 86 focused tests passed. The checked webview tree is identical to this head (e09b16d9ef103166cfb2d4bbb6206f208703a3c9). Both new saved-worktree regressions fail against the previous reviewed head 32f065b6: a delayed success must not launch the old chat, and a delayed failure must not show a stale error; either case allows a fresh Auto submission. The prior routing and folder-worktree regressions also pass. The static prepush gate reports no new violations. Existing type-scale, formatting and protocol findings also occur on base b7b9749c1ce12486a309e56dc5ec7a288919ac4f.

Refreshed head capture rendered the same environment-picker case as the before image, with the same displayed layout as this head (subsequent changes only guard pending callbacks); it recorded a 51.7 ms menu-opening frame against the 33 ms limit. The earlier gallery capture rendered all five cases. The main before/after case and named-machine variant passed. Two alternative variants exceeded the frame-time threshold; the legacy classic-search case timed out. A base comparison also fails classic-search, earlier on layout shift, so the timeout is not yet proven equivalent. These gallery failures remain recorded; no blanket gallery pass is claimed.

The latest review findings are addressed: destination intent is required, project matching includes machine identity, and selecting Auto invalidates pending folder-worktree replies and pending saved-worktree submissions (including stale errors). Independent re-review is pending on this head. Auto uses prompt heuristics; explicitly picking a machine disables automatic routing for that draft.

BeforeAfter
BeforeAfter

Other captured states: cloud, named machine.

Agent session: agent session