webviews: New Worktree shows the host's folder question instead of ending silently (cx-lyqio.7)
New Worktree no longer ends silently when the host asks about the worktree's folder (cx-lyqio.7, reported by op-next-icons).
newWorktree made the worktree, then passed its folder through pickFolder and dropped the answer. When workspace.useFolder asks first (confirm), pickFolder hands back the question and uses nothing, so no chat started and nothing showed. Now newWorktree returns that question, and startInWorktree shows it above the composer as a picked folder's question is. Use Home Folder then starts the chat in the worktree.
From the review:
- With today's macOS host this is defensive. It asks only about the home folder itself and refuses
/and folders above home, and a worktree under~/.cmux/worktreesis neither. - A worktree whose folder the host calls no folder (
transport.path_invalid) still ends without a message. That's left as is. - Keep or Use Private Folder leaves the worktree on disk, as a superseded pick already does.
Tests
chat-new-worktree.test.tsx: "a folder question about the worktree comes back to ask, and starts nothing yet".
| Commit | Red | Green |
|---|---|---|
| 2aedeac3e5f4 (test, with the return type; eca012174e3e failed typecheck, so it doesn't count) | run 38211468757: the test fails | ca39f3782a9d, run 38211538373 |
The Release compile on ca39f3782a9d is green (fleet wtask-rel).
Changelog
- Fixed: New Worktree shows the host's question about the worktree's folder instead of starting nothing.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Fixes New Worktree ending silently when the host asks about the worktree's folder instead of starting a chat.
Previously,Skip newWorktree made the worktree then passed its folder through pickFolder and dropped the answer. When workspace.useFolder asks first (confirm), pickFolder hands back the question and uses nothing,Skip so no chat started and nothing showed. Now,Skip newWorktree returns the question,Skip and the pane shows it above the composer like a picked folder's question. Choosing Home Folder then starts the chat in the worktree.
Caveats:
- The question is defensive on today's macOS host: it only asks about the home folder itself and refuses
/and folders above home. - A worktree whose folder the host calls no folder (
transport.path_invalid) still ends without a message,Skip left as is. - Keep or Use Private Folder leaves the worktree on disk,Skip as a superseded pick already does.
Tests add coverage in chat-new-worktree.test.tsx for the folder question coming back to ask and starting nothing yet.