Repository navigation
Description
Summary
Installing or updating a plugin from a git: source makes bb run a full git clone of the whole repository, then git checkout <commit>, and then it deletes .git anyway. For a plugin that lives in a large or long-lived repository (for example a marketplace monorepo that holds many plugins), each install, update, and install-probe downloads the complete history before anything else happens; on a slow link this takes minutes or hits the 5-minute command timeout. I expected bb to download only the resolved commit.
Versions and environment
- bb 0.49.0 (Nix-packaged upstream build of
get-bb/bb, run with--data-dir), macOS 27.2.1, git 2.56.1 - Reproduced in the repo's own test suite on
mainatfab82665a3299fae8910f55d7519a3b034a03b9a - Nothing provider-related; this is the plugin install path on the server
Steps to reproduce
- Register a marketplace or install a plugin whose
git:source is a repository with a large history, e.g.bb plugin install git:github.com/<org>/<big-monorepo>@main --plugin <name>. - While the install job is running,
ps aux | grep 'git clone'and watchdu -sh <dataDir>/plugins/cache/git/<host>/<org>/<repo>/<sha>.install-probe-*/.gitgrow. - Compare with
git init t && git -C t fetch --depth 1 <url> <sha>for the same commit.
Minimal fixture-level repro: a repository that carries a ref whose object is missing. git clone refuses it, while fetching the resolved commit by SHA succeeds, so a plugin install from that repository fails today even though the plugin's commit is intact. (This is the deterministic form used in the test that accompanies the fix.)
Expected vs actual
Actual (bb 0.49.0, marketplace monorepo with ~90 plugins):
git clone --quiet https://github.com/<org>/<monorepo>.git .../<sha>.install-probe-<uuid>
... .git reached 624 MB and was still downloading after several minutes;
two such clones ran concurrently (one install probe, one update staging);
the marketplace refresh for the same repo reported "git -c timed out".
Expected:
git init + git fetch --depth 1 <url> <sha> + checkout FETCH_HEAD
same commit: 8.8 s, 82 MB of .git, and bb deletes .git right after checkout anyway.
Evidence
- Code:
cloneGitCommitat—bb/apps/server/src/services/plugins/managed-plugin-artifacts.ts
Lines 148 to 175 in fab8266
async function cloneGitCommit( url: string, stagingDir: string, commit: string, notFoundHint?: string, ): Promise<void> { await runInstallCommand("git", ["clone", "--quiet", url, stagingDir], { notFoundHint, }); await runInstallCommand("git", [ "-C", stagingDir, "checkout", "--quiet", "--detach", commit, ]); const checkedOutCommit = await runInstallCommand("git", [ "-C", stagingDir, "rev-parse", "HEAD", ]); if (!checkedOutCommit.startsWith(commit)) { throw new Error( `git resolved ${commit}, but checked out ${checkedOutCommit}`, ); } git clonewith no--depth/--filter, thencheckout --detach <commit>, thenrm .git. - All three callers (install, install probe for semver ranges, update staging) go through it: L628, L795, L1215 of the same file.
- The resolved commit is always a full 40-hex SHA (validated in
update-resolver.tsls-remoteparsing), so it can be fetched directly on servers that allow it (GitHub, GitLab, Bitbucket, and any local path repo with protocol v2). - Measured with
timeanddu -shon the same commit of the same repository.
What you ruled out
- Not the npm install or esbuild build step: both run after the clone finishes and take seconds.
- Not network-only: the same host fetches the single commit in under 10 s.
- No existing issue: searched "clone", "shallow", "depth", "plugin install slow";
bb marketplace addfails for a git branch other than the default branch #5373 is about marketplace branch refs, not clone size.
Suggested priority and effort
Hits every user who installs from a git monorepo or any repository with a long history; the workaround is to publish the plugin on npm. Small change in one function plus a fallback to the full clone for servers that refuse fetch-by-SHA.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 20, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotplugins,perf.confirmed-repro..git, unnecessarily requiring ancestor objects.Fetch only the resolved commit for git plugin installs (get-bb#7911)