Repository navigation
Description
Summary
In a project checkout that bb cloned onto a machine, a thread fails to start whenever its branch is not the remote's default: a new branch from dev, or an existing branch such as release. bb's clone holds only the default branch locally, and for a machine with no checkout yet the picker lists origin's branches without origin/. The host passes that bare name to git, which cannot resolve it.
Versions and environment
- bb 0.46.1 (latest release). The host daemon runs on Debian 13 (Linux 6.12) with git 2.55.0.
- Also reproduced from source at
maine0f6fda, in the integration harness and the plugin's host test harness on macOS (git 2.54.0, Node 22.23.2). No commit has touched the code below since 0.46.1. - The trigger is a checkout like the one bb makes on a new machine:
git clone --progress <remote> <path>.
Steps to reproduce
R=$(mktemp -d) && cd "$R"
git init -q --bare -b main origin.git
git init -q -b main seed
git -C seed commit -q --allow-empty -m "on main"
git -C seed push -q ../origin.git main
git -C seed switch -q -c dev && git -C seed commit -q --allow-empty -m "on dev only"
git -C seed push -q ../origin.git dev
git clone -q origin.git clone-b
git -C clone-b branch --list # * main
bb thread spawn --project <any project on that machine> --host <machine> \
--environment-provider project-checkout \
--environment-inputs "{\"path\":\"$R/clone-b\",\"branch\":{\"kind\":\"new\",\"baseBranch\":\"dev\"}}" \
--prompt "Reply with exactly: OK. Run no command, read no file."In the app, the picker gives that bare name for a thread whose machine is not created yet (hostId === null): Project checkout → New branch → dev.
With "baseBranch":"origin/dev", the same steps start the thread. The bare name is the trigger.
Expected vs actual
Actual: the thread ends in error, and its log says:
git switch -C bb/claude-repro-b-base-dev-on-a-plain-clone-to-arch-thr_qakpvmfvxw dev failed: fatal: invalid reference: dev
── Provisioning thread failed ──────────────────────────────
Workspace setup failed
The plugin's host entry answers the same in such a clone, for a new branch and for an existing one (attach at e0f6fda):
{"status":"failed","message":"git switch -C bb/x dev failed: fatal: invalid reference: dev"}
{"status":"failed","message":"Cannot checkout missing branch release"}
The integration tests in the linked PR hit both errors at e0f6fda, through the server, the daemon and the bundled plugin.
Expected: the new branch starts from origin/dev, release is switched to tracking origin/release, and the thread starts.
Evidence
- For a machine with no checkout yet, the picker lists origin's branches without
origin/: app.tsx#L351-L357. It came in with Machine providers: durable lifecycle and shared plugin APIs #3274. - bb clones the project with a plain clone, which keeps only the default branch locally: project.ts#L101.
- The host makes the new branch from the bare base: checkout.ts#L121-L124.
- The host accepts an existing branch only when it is local: checkout.ts#L86-L93.
- Thread
thr_qakpvmfvxw, archived after the repro.
What you ruled out
- Not a duplicate: I searched issues and PRs for "base branch", "fresh clone", "invalid reference", "remote branch" and "project checkout". spawn --base-branch <name> resolves the stale local ref; only remote-prefixed names are fetched #1917 and Worktree provider provisions stale refs and long-lived manager turns can silently search old code #3955 are about stale local refs in the worktree provider. Here the ref is missing.
- Not the machine: the host entry fails the same way in a plain clone on macOS.
Suggested priority and effort
Every project-checkout thread on a bb-cloned machine whose branch is not the default fails to start. For such a machine, the picker offers no way around it. The workaround is the CLI with an origin/-prefixed base, or creating the local branch on the machine by hand. No work is lost. The fix is small, in the plugin's host only.
AGENT GENERATED
Activity
alexandre-vl commentedon Oct 20, 2026
Still reproduces on
mainat 81b48d3, after #5856. In the integration harness, in a plain clone:#5856 records the base as given. A fix on the host alone would make the branch from
origin/devand recorddev, which does not resolve in that clone, so the thread's commits would drop out of its diff. #5855, reopened and rebuilt onmain, has the host report the ref it used. #5885 makes the same fix and is superseded.Take a project checkout's base and existing branches from origin when…
Take a project checkout's base and existing branches from origin when…
Resolve local-vs-origin branch refs with one shared resolver (#7719)