Skip to content

[BUG] Worktree Lifecycle Failure: "No Branch" UI, .worktreeinclude Sync Skip, and "Zombie" Worktree States #12140

@OsaMusa

Description

@OsaMusa

Problem (one or two sentences)

Roo Code fails to handshake with new Git worktrees, resulting in a "No Branch" UI status, silent failure of .worktreeinclude file syncing, and a "Ghost State" that prevents reusing worktree names for already deleted worktrees.

Context (who is affected and when)

This affects any user trying to manage multiple versions of their code simultaneously (worktrees) on a Windows computer. It specifically happens when creating a new workspace or trying to clean up an old one using the default folder settings. This was discussed with the support team on 4/16/2026, who confirmed the system is likely struggling to coordinate between the files being ignored and the cleanup of old project names.

Reproduction steps

  1. Create a .worktreeinclude file in the root containing an ignored directory (e.g., venv/).

  2. Create a folder (e.g., data_prep/) where some items are ignored (e.g., local_only/) but at least one file is tracked (e.g., prepare.py).

  3. Create a new worktree using the Roo Code "Worktrees" settings.

  4. Observe the Roo Home screen and the file explorer in the new window.

  5. Delete the worktree via the Roo UI.

  6. Attempt to create a new worktree with the exact same name.

Expected result

Roo Code should automatically detect the branch context upon initialization, successfully copy all assets listed in .worktreeinclude regardless of tracked sibling files, and purge the internal registry immediately upon deletion.

Actual result

The UI stays stuck on "No Branch," ignored directories fail to sync when parent folders contain tracked files, and a "Ghost State" prevents name reuse after deletion due to a registry disconnect.

Variations tried (optional)

  • Confirmed paths via git check-ignore -v to ensure .gitignore patterns were correct.

  • Performed git worktree list manually to confirm no other trees existed, but the "already exists" error persisted in the Roo UI.

  • Attempted syncing directories with various structures; file syncing failed to function in all tested scenarios, even when the directory was 100% untracked.

App Version

3.52.1

API Provider (optional)

None

Model Used (optional)

No response

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions