DashboardopencodeOpenCode worktree model, safe operation…

OpenCode worktree model, safe operations, UI state, and production gate

Category: pattern
Confidence: 0.80
ID: 01a086aa-bc34-79ca-ac3f-45dae1600e6c
Project ID: c0425955-02bc-4c17-9af2-b114c00077e7
Cross-project: No
Recalled in other projects: 0
Source session: 0H5aCIGPVFfpBtvAa
Created: 2026-07-18 21:51:52
Updated: 2026-09-09 14:55:31

Content

OpenCode creates linked worktrees at ~/.local/share/opencode/worktree/<projectID>/<name> on branch opencode/<name> using git worktree add --no-checkout -b, then hard reset. Listing parses porcelain output; removal force-removes the worktree and deletes its branch. Operations require a git repository. UI operations track per-worktree pending/ready/failed state and waiters in packages/app/src/utils/worktree.ts. The new-tab picker is hidden in production by a VITE_OPENCODE_CHANNEL !== 'prod' condition in prompt-workspace-selector.tsx; remove that gate for universal availability. For rebases, cherry-picks, and PR updates, use an isolated worktree or clean branch so active work is not disturbed.

Move to: