mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Desktop sessions now resolve repository launch intent before creation, so users can pick a branch, choose whether to isolate it in a worktree, and get stable error messages instead of silent branch-switch failures. The server owns the Git safety checks and session metadata so the UI and real agent runtime agree on the actual working directory. Constraint: Direct branch switching must not overwrite or hide uncommitted user changes Constraint: Desktop worktree branches must stay out of normal branch selection and recent-project labels Rejected: Let the UI call git directly | server-side checks keep session metadata and runtime launch paths consistent Rejected: Auto-switch dirty checkouts | users need an explicit isolated-worktree choice to protect local edits Confidence: high Scope-risk: moderate Directive: Do not relax dirty-worktree or checked-out-branch guards without adding equivalent business-flow tests Tested: ALLOW_CLI_CORE_CHANGE=1 bun run quality:pr Tested: /tmp business-flow script with dirty checkout, checked-out branch, isolated worktree, missing branch, non-git, missing directory, and real LLM session Tested: agent-browser desktop UI flow across dirty, checked-out, non-git, branch search, recent-project, and Run scenarios