Skip to content

feat(open): Ask whether to open the session in a worktree - #100

Merged
4ndreello merged 2 commits into
mainfrom
feat/open-worktree-prompt
Sep 22, 2026
Merged

4ndreello merged 2 commits into
mainfrom
feat/open-worktree-prompt

Conversation

@4ndreello

Copy link
Copy Markdown
Owner

Interactive codedeck open now asks Open in a worktree? [y/N]: right after the role is chosen, so starting a session isolated no longer depends on remembering --worktree.

  • y/yes takes the existing --worktree path: claude gets -w, opencode and codex get a CodeDeck worktree through prepareOpenWorktree.
  • Enter, n or no opens in the current directory. Any other answer asks again; Ctrl+D rejects before the daemon starts or a session is adopted.
  • No question with --worktree, the new --no-worktree, --resume (a resumed session belongs to its original cwd), -p/--print, a non-TTY, or a cwd outside a git repository.
  • The --worktree help text no longer says it only asks Claude Code; it applies to all three launchers.

Spec: .specs/features/open-worktree-prompt/spec.md (OWP-01 to OWP-10).

Tests

  • npx vitest run tests/open-worktree-prompt.test.ts: 10 passed
  • npx vitest run tests/open-action.test.ts tests/open-args.test.ts tests/open-codex.test.ts tests/open-opencode.test.ts: 202 passed
  • npx tsc --noEmit: clean
  • Mutation probe: treating an empty answer as yes failed OWP-03; dropping the --resume guard failed OWP-10.

README line 108 still says opencode --worktree warns and continues without isolating, which no longer matches prepareOpenWorktree. Left for a separate change.

Interactive opens in a git repository now ask once whether to start in a worktree. A yes takes the existing --worktree path; --worktree and the new --no-worktree skip the question, and so do --resume, -p/--print and non-TTY launches.
The gates drive open under script(1) inside the checkout, so the new worktree question blocked them until timeout. Passing --no-worktree keeps them on the launch path they test, the same way they already pass the role.
@sonarqubecloud

Copy link
Copy Markdown

@4ndreello
4ndreello merged commit 13f89c4 into main Sep 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant