Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Jan 5, 2026

Closes #10646

image image

Thanks to Cline / Saoud for the inspiration.

I had Opus take a peek at their WIP implementation and port it over.

I also added a --worktree option to the Roo Code cli which will automatically run your task in a new worktree.

Screenshot 2026-01-04 at 10 50 13 PM Screenshot 2026-01-04 at 10 50 37 PM Screenshot 2026-01-04 at 10 52 33 PM

Important

This pull request adds comprehensive Git worktree management to the VSCode extension, including UI components, backend handlers, and internationalization support.

  • Behavior:
    • Adds Git worktree management to the VSCode extension, allowing users to create, delete, and manage worktrees.
    • Introduces worktreeAutoOpenPath to auto-open Roo Code sidebar when switching worktrees.
    • Handles multi-root and subfolder workspaces by displaying appropriate error messages.
  • UI Components:
    • Adds WorktreesView, CreateWorktreeModal, and DeleteWorktreeModal components for managing worktrees.
    • Integrates SearchableSelect for branch selection in CreateWorktreeModal.
    • Updates App.tsx to include a new "worktrees" tab.
  • Commands and Handlers:
    • Adds handleListWorktrees, handleCreateWorktree, handleDeleteWorktree, handleSwitchWorktree, and other handlers in handlers.ts.
    • Registers new commands in registerCommands.ts and package.json.
  • Internationalization:
    • Adds translations for worktree-related strings in multiple languages, including English, Spanish, and Japanese.

This description was created by Ellipsis for b518ada. You can customize this summary. It will automatically update as commits are pushed.

@cte cte requested review from jr and mrubens as code owners January 5, 2026 06:57
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Enhancement New feature or request labels Jan 5, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 5, 2026

Rooviewer Clock   See task on Roo Cloud

All previously flagged issues have been resolved. Latest changes make normalizePath cross-platform compatible by handling both forward slashes and backslashes. No new issues found.

  • Security: Remove hardcoded API key in apps/cli/src/index.ts:132
  • Bug: Fix branch deletion logic in deleteWorktree() - worktree info must be retrieved before deletion, not after
  • Bug: Fix worktreeIncludeStatus message handling in WorktreesView.tsx - line 73 should extract message.worktreeIncludeStatus instead of storing entire message
  • Bug: Fix worktreeIncludeStatus message handling in CreateWorktreeModal.tsx - line 76 should extract message.worktreeIncludeStatus instead of storing entire message
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jan 5, 2026
Base automatically changed from cte/cli-evals to main January 5, 2026 19:33
@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jan 6, 2026
@hannesrudolph hannesrudolph moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Jan 6, 2026
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jan 6, 2026
cte and others added 11 commits January 20, 2026 13:37
- Add worktrees.json translation files for all 17 locales
- Add command.worktrees.title translation to all package.nls locale files
Performance:
- Parallelize git commands in getAvailableBranches() using Promise.all
- Add maxDisplayItems prop to SearchableSelect (default 50) to improve dropdown performance
- Disable cmdk's slow built-in filtering for large option lists

UX Improvements:
- Add loading spinner while branches load with i18n support
- Add onWheel handler to CommandList for VSCode webview scroll compatibility
- Round modal input fields with rounded-full class
- Apply consistent WorktreesView styling (rounded-xl, transparent borders, hover effects)

Branch .worktreeinclude Check:
- Add branchHasWorktreeInclude() to check if selected base branch has .worktreeinclude committed
- Show warning when base branch doesn't have .worktreeinclude (not local filesystem)
- Add checkBranchWorktreeInclude message type and handler

Translations:
- Add searchBranch, noBranchFound, loadingBranches keys to all 18 locales
The test performs 9 sequential git operations which can exceed the default
5000ms timeout on Windows CI. Increased to 30s for reliability.
daniel-lxs added a commit that referenced this pull request Jan 20, 2026
… true

Matt pointed out in PR #10458 review that this behavioral change should be
handled separately. This reverts to the original behavior where:

- parallel_tool_calls is only sent to API when explicitly set to true
- When false or undefined, the parameter is omitted entirely (allows API defaults)

Updated 13 provider files and 8 test files to restore this behavior.
- Replace polynomial regex /\/+$/ with iterative while loop to prevent ReDoS
  (also fixes bug where root path / was incorrectly converted to empty string)
- Use execFileAsync with argument arrays instead of execAsync with string
  interpolation to prevent shell command injection
- Add comprehensive unit tests for normalizePath and parseWorktreeOutput

Fixes 8 CodeQL alerts:
- 1 high severity: Polynomial regular expression
- 7 medium severity: Unsafe shell command construction
- Handle both forward slashes (/) and backslashes (\) in trailing path removal
- Update test for root path to use path.sep for Windows compatibility
- Align implementation with existing src/utils/path.ts normalizePath

Fixes Windows CI test failures for worktree-service tests.
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 20, 2026
@cte cte merged commit 04256be into main Jan 20, 2026
13 checks passed
@cte cte deleted the cte/worktrees branch January 20, 2026 21:39
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jan 20, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Preliminary Review size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Git worktree management (enables parallel development workflows)

5 participants