Repository navigation
Discover user-managed Git worktrees in the thread composer - #3698
Closed
banjerluke wants to merge 4 commits into
Closed
banjerluke wants to merge 4 commits into
banjerluke wants to merge 4 commits into
Conversation
Discover Git worktrees registered outside bb and expose them through the daemon, project API, SDK, CLI, and new-thread picker. Use canonical host/path identity so reusable environments take precedence while locked, stale, detached, and unavailable worktrees remain explicit. Ownership follows the environment provider architecture: a discovered worktree starts a thread through the Project checkout provider at its path, which never removes an attached directory or its branch. Ephemeral sandbox machines are not scanned. The new-thread composer merges discovered rows into the reuse environment picker and regains an "Existing environment" row so discovery is browsable; a selection that disappears after a refresh stays in reuse mode instead of silently retargeting the thread. Bump the host-daemon protocol for the new host.list_worktrees command and cover discovery, merging, and lifecycle behavior end to end. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
lukes-clanker
Bot
force-pushed
the
feat/issue-1-worktree-discovery
branch
from
September 15, 2026 16:19
7d5c250 to
963d906
Compare
Collaborator
|
Thank you for this! I added support for this in #3932 |
Collaborator
|
This will go out with the next release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
This was a blocker for me using bb with an established project where I have work in progress going on different worktrees.
Closes #1624
Re-submission of #2482
What was wrong
The new-thread composer built its reuse choices from BB environments associated with threads. Git worktrees created outside BB were therefore invisible, even though the existing Project checkout provider could already attach a supplied path. The missing pieces were host-local Git discovery and canonical path matching against project sources and stored environments.
What changed
git worktree list --porcelain -z, including branch or detached checkout, lock state, prunable state, and canonical paths.host.list_worktreesdaemon RPC and bumpedHOST_DAEMON_PROTOCOL_VERSIONfrom 208 to 209.inputs.path; the thread-create request shape is unchanged.sdk.projects.worktrees(...)andbb project worktrees <project-id> [--json], with dedicated CLI formatting and matching guide, skill, and worktree documentation.Discovery does not create or prune worktrees or add persistence. Existing checkout-provider lifecycle behavior preserves user-managed directories, branches, and Git registrations when their threads are archived or deleted.
How you verified
git diff --check origin/main...HEADpassed.Earlier user verification covered desktop collision scrolling and the compact responsive drawer. Browser QA was not repeated after this rebase.