feat: Add on-demand worktree sessions via /wt command #2

Merged
dries merged 1 commit from feat/worktree-sessions into main 2026-05-03 14:47:04 +02:00
Owner

Summary

  • Adds on-demand git worktree sessions so parallel OpenCode coding tasks get isolated working directories, staging areas, and builds — invoked via /wt in the command palette or composer.
  • New internal/worktree Go package handles git worktree add/list/remove, slug generation, and default base-ref detection; three API endpoints (/api/worktree/list, /api/worktree/default-base-ref, /api/worktree/create-and-launch) wire it to the frontend.
  • Idempotent tmux launcher reuses existing session/window pairs instead of stacking duplicate opencode instances; named wt-<slug> windows keep worktrees grouped inside the project's tmux session.
  • Frontend: WorktreeFormModal (project picker, branch input, new-branch toggle, base-ref selector), WorktreesView per-project page, capability-gated palette/composer entries via useWorktreeSessions(), and sidebar grouping of worktree sessions under their project root.
  • Comprehensive tests: Go table-driven tests for the worktree package, handler tests with fakePlatform, tmux idempotency tests with stubbed runner, and frontend unit tests for modal/store/api/worktree helpers.
## Summary - Adds on-demand git worktree sessions so parallel OpenCode coding tasks get isolated working directories, staging areas, and builds — invoked via `/wt` in the command palette or composer. - New `internal/worktree` Go package handles `git worktree add/list/remove`, slug generation, and default base-ref detection; three API endpoints (`/api/worktree/list`, `/api/worktree/default-base-ref`, `/api/worktree/create-and-launch`) wire it to the frontend. - Idempotent tmux launcher reuses existing session/window pairs instead of stacking duplicate opencode instances; named `wt-<slug>` windows keep worktrees grouped inside the project's tmux session. - Frontend: `WorktreeFormModal` (project picker, branch input, new-branch toggle, base-ref selector), `WorktreesView` per-project page, capability-gated palette/composer entries via `useWorktreeSessions()`, and sidebar grouping of worktree sessions under their project root. - Comprehensive tests: Go table-driven tests for the worktree package, handler tests with fakePlatform, tmux idempotency tests with stubbed runner, and frontend unit tests for modal/store/api/worktree helpers.
dries force-pushed feat/worktree-sessions from 42cdc9be43
Some checks failed
CI / Frontend (pull_request) Failing after 30s
CI / Backend (pull_request) Successful in 59s
CI / Build (pull_request) Has been skipped
CI / Playwright E2E (pull_request) Failing after 2m59s
to bcbfde1f3c
Some checks failed
CI / Frontend (pull_request) Successful in 47s
CI / Backend (pull_request) Successful in 37s
CI / Playwright E2E (pull_request) Has been cancelled
CI / Build (pull_request) Has been cancelled
2026-05-03 14:41:13 +02:00
Compare
dries force-pushed feat/worktree-sessions from bcbfde1f3c
Some checks failed
CI / Frontend (pull_request) Successful in 47s
CI / Backend (pull_request) Successful in 37s
CI / Playwright E2E (pull_request) Has been cancelled
CI / Build (pull_request) Has been cancelled
to 76cb28f5fe
Some checks failed
CI / Frontend (pull_request) Successful in 47s
CI / Backend (pull_request) Successful in 58s
CI / Playwright E2E (pull_request) Failing after 2m46s
CI / Build (pull_request) Successful in 1m12s
CI / Frontend (push) Successful in 47s
CI / Backend (push) Successful in 58s
CI / Playwright E2E (push) Failing after 2m46s
Semantic Tag / tag (push) Successful in 3s
CI / Build (push) Successful in 1m13s
2026-05-03 14:43:40 +02:00
Compare
dries merged commit 76cb28f5fe into main 2026-05-03 14:47:04 +02:00
dries deleted branch feat/worktree-sessions 2026-05-03 14:47:04 +02:00
Sign in to join this conversation.
No description provided.