Setting for where task worktrees are created (e.g. a sibling folder instead of .worktrees/ inside the repo)

Aperta
#324 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

@salmanmkc ci sta già lavorando.

Dal 26/10/2026.

  • #325 di @salmanmkc — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, electron, git, typescript

Direzione di ricerca

Start in electron/ipc/git.ts at worktreePathFor, then trace how project settings are stored and how new task worktrees are created. Review coverage.ts, BranchPrefixField, and mergeTask for the stated .worktrees assumptions. Before implementation, resolve the scope questions about app-wide defaults, coordinator sub-tasks, and Arena and document-run worktrees; done means the setting is validated and new tasks use it while existing task paths remain intact.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

Task worktrees always go to <repo>/.worktrees/<branch> (worktreePathFor in electron/ipc/git.ts). The .git/info/exclude entry keeps them out of git status, but plenty of tools walk the directory tree without reading git's exclude file, so every task's files show up again in the main checkout:

  • Jest's haste map crawls them, and the duplicate package.json names fail with "Haste module naming collision"
  • tsc without an include compiles every .ts file under the project folder, worktrees included
  • eslint . lints them, since flat config only ignores node_modules and .git by default
  • docker build . sends them in the build context unless .dockerignore lists them
  • dev-server file watchers running in the main checkout watch every task's files too

A configurable location is a common ask upstream as well: anthropics/claude-code#27282 (sibling folder, 72 👍) and openai/codex#10599 (configurable root, 77 👍).

Proposal

An optional per-project "Worktree folder" setting next to the branch prefix. Empty keeps today's behavior, so nothing changes unless you set it.

  • New tasks go to <folder>/<branch>. Existing tasks keep their saved worktreePath, and merge and delete already use it.
  • Stored in app state with the other project settings, not in a repo file (same reasoning as #231).
  • Validated in the main process: absolute after ~ expansion, not the repo root, not inside .git, created if missing. A folder inside the repo gets its own .git/info/exclude entry, the way .worktrees/ does now.
  • Regular Docker tasks only mount the worktree itself, so they aren't affected by where it lives. The parent-folder mount (dockerMountWorktreeParent) is only set for Docker coordinator tasks and the tasks they coordinate.
  • I'd also fix the few places that assume .worktrees: the repo-name guess in coverage.ts, the path preview in BranchPrefixField, and the fallback path in mergeTask.

Questions before I start

  1. Per-project only, or also an app-wide default in Settings (e.g. ~/worktrees/{project})?
  2. MCP coordinator sub-tasks are created in the main process with a hardcoded task prefix, so they already ignore project settings. Leave them in .worktrees/, or pass the folder through coordinator registration? This matters for Docker too: a Docker coordinator whose own worktree is in a custom folder wouldn't have its .worktrees/task/ sub-tasks in that parent-folder mount.
  3. Arena and document-run worktrees: keep them in .worktrees/?

Happy to send a PR if this direction works for you.

Lingua principale
TypeScript
Stelle
1k
Fork
144
Merge medio
4g 19h
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di johannesjo/parallel-code

Tutte le issue di johannesjo/parallel-code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.