Add user-managed worktrees to thread composer - #2482
Open
banjerluke wants to merge 2 commits into
Open
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. Preserve user-owned worktrees after their last thread is archived or deleted. Bump the host-daemon protocol for the wire-contract change and cover discovery and lifecycle behavior end to end.
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
What was wrong
The new-thread composer built its Existing worktree choices only from bb environments associated with active threads. Git worktrees created and owned by the user were therefore invisible in the app, even though thread creation could already attach an explicit unmanaged path. The missing piece was host-local Git discovery plus canonical path matching across discovered worktrees, project sources, and stored environments.
What changed
git worktree list --porcelain -z, including branch or detached checkout, lock state, prunable state, and host-canonical paths.host.list_worktreesdaemon RPC and bumpedHOST_DAEMON_PROTOCOL_VERSIONfrom 170 to 171.(host, path)identities, preserves bb-managed precedence, and reports partial per-machine failures.sdk.projects.worktrees(...)andbb project worktrees <project-id> [--json], with matching guide and built-in skill documentation.This remains discovery-only. It does not add branch continuation, change generated branch naming, prune user worktrees, add persistence, or alter the thread-create request shape.
How you verified
pnpm exec turbo run typecheckwith filters for@bb/db,@bb/server,@bb/cli,@bb/app,@bb/host-daemon-contract,@bb/host-workspace,@bb/host-daemon,@bb/sdk, and@bb/server-contract— 12/12 Turbo tasks passed after rebasing onto current upstreammain.git diff --check upstream/main...HEADpassed.Live browser QA of desktop collision scrolling and the compact responsive drawer was performed by the user.