worktree start crashes with EEXIST when a worktree-symlinks entry is a tracked file #1297
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1297
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
worktree start <name>crashes when.cc-os/configlists a path underworktree-symlinksthat git already checks out in the new worktree.git worktree addcreates the tracked file, thenWorktree::Checkout#link_extra_pathscallsFileUtils.ln_son the same path and raisesErrno::EEXIST. The worktree is left half-linked and the command exits 1 with a Ruby backtrace instead of a printed reason.Observed
The finance repo tracks
.sdlc/project.yaml(its .gitignore has!.sdlc/project.yaml) and its config hadworktree-symlinks=.venv,.sdlc/project.yaml.Reproduce
Approach
Skip a symlink target that already exists in the new worktree, or print one line naming the entry and continue. A config check that warns when a worktree-symlinks entry is git-tracked would also prevent it.
Required work: none beyond the acceptance criteria.
Acceptance criteria
worktree startruns, then it completes with the standard output lines and the tracked file is left as checked out.Discoverer: /home/jared/projects/finance, session f6b97de2-a65d-4ecf-9dd4-848bc0302154, 2026-10-23. Hit while opening the ticket-30 worktree for /os-sdlc:implement; worked around by removing the tracked entry from the finance config.
From #1589 port check: NOT FIXED. Links#link_extra checks only that the source exists (plugins/os-git/lib/os_git/worktree/links.rb:129-134), then Links#link calls FileUtils.ln_s on the target (links.rb:136-139). A git-tracked entry already exists in the new worktree, so ln_s raises Errno::EEXIST. Nothing rescues it in Start#create (plugins/os-git/lib/os_git/worktree/start.rb:202-211). The same applies to .cc-os at links.rb:33. Not closed.
Correction to the last comment: the verdict stands (not fixed), but the line reference was wrong. The code is plugins/os-git/lib/os_git/worktree/links.rb:75-78 (link).