#6802 · Plugin update checks lack per-plugin failure isolation
Verdict: REPRODUCED · Root-cause confidence: high
1. TL;DR
An installed plugin whose Git source disappears makes the shared update-check API return HTTP 422 without a results array, even with a healthy installed plugin. This is not an installation failure: both plugins install successfully before one source directory is moved away. A real Git process rejects the source lookup, and the update worker lets that rejection escape its shared Promise.all. Branch selectors and semantic-version ranges both reproduce the failure. The same agent repeated the test in a second clean checkout before testing a small per-plugin isolation repair.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| One unreachable Git source aborts the complete check | Verified | Both selector cases return 422 rather than a results array containing unavailable and current entries. |
| Failure affects healthy plugins too | Verified at the API response | The other local Git source remains intact. It has no result in the failed response. Some concurrent worker persistence may still complete; this is not a claim that all stored results are erased. |
| The Git lookup rejection escapes the worker | Verified | Real Git against a moved local repository, plus the trusted source chain below. |
| CLI, Settings and periodic checks share the defective operation | Source-traced; not separately run live | CLI → SDK → check route; settings query → same SDK method; periodic task → same service method. |
| Specific macOS SSH-credential failure | Not separately exercised | Linux local-source removal reproduces the same nonzero Git-command rejection without any credentials or external remote. |
3. Environment
- Public get-bb/bb, trusted origin/main at
916d684ac23d0b0de82c09cfc7553a50287d2188; unchanged production code in both reproduction checkouts. - Linux x86_64, Node v22.19.0, pnpm 9.15.0, Git 2.39.5, Vitest 4.1.1.
- Real migrated SQLite via createMigratedConnection; genuine temporary Git repositories and plugin installation/builds.
- No listening application server, no real user store, credentials or provider session. Hono handles the request in process; the test harness creates and removes fresh temporary data directories for each case and each checkout.
4. Minimal reproduction
- Clone the trusted public repository and select the recorded commit:
git clone --branch main https://github.com/get-bb/bb.git bb-6802-repro cd bb-6802-repro git checkout 916d684ac23d0b0de82c09cfc7553a50287d2188 pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@bb/server
- Insert the test below inside the existing
describe("plugin update service and routes", ...)block inapps/server/test/services/plugins/plugin-update.test.ts, immediately before the existing offline-npm-registry test. It deliberately reuses that file's real installation, database, route and taggedRepo fixtures.it.each(["main", "semver:^1.0.0"])( "keeps healthy plugin results when the git remote for %s is unavailable", async (selector) => { const tagged = await taggedRepo(); await service.install(`git:${tagged}@${selector}`, { kind: "root" }); const offline = join(workDir, "offline"); await rename(tagged, offline); const response = await app.request("/plugins/updates/check", { method: "POST", headers: { "content-type": "application/json" }, body: "{}", }); expect({ status: response.status, ...(await response.json()), }).toMatchObject({ status: 200, results: [ { id: "tagged", outcome: "unavailable", detail: expect.stringContaining("git ls-remote failed"), }, { id: "updater", outcome: "current" }, ], }); expect(service.listUpdateResults()).toMatchObject([ { id: "tagged", outcome: "unavailable" }, { id: "updater", outcome: "current" }, ]); await rename(offline, tagged); await expect(service.checkForUpdates("tagged")).resolves.toMatchObject([ { id: "tagged", outcome: "current" }, ]); }, ); - Run the focused regression on unchanged production code:
pnpm exec turbo run test --filter=@bb/server -- test/services/plugins/plugin-update.test.ts -t 'keeps healthy plugin results'
Expected: HTTP 200 with two ordered results: tagged/unavailable including the Git error, updater/current. Both entries should be persisted, and restoring the source should make the next targeted check return current.
Actual: HTTP 422; both parameterized cases fail before persistence/recovery assertions can run. The following is the verbatim assertion output (ANSI styling omitted):
@bb/server:test: FAIL |@bb/server:isolated| test/services/plugins/plugin-update.test.ts > plugin update service and routes > keeps healthy plugin results when the git remote for main is unavailable
@bb/server:test: FAIL |@bb/server:isolated| test/services/plugins/plugin-update.test.ts > plugin update service and routes > keeps healthy plugin results when the git remote for semver:^1.0.0 is unavailable
@bb/server:test: AssertionError: expected { status: 422, …(1) } to match object { status: 200, results: [ …(2) ] }
@bb/server:test: (1 matching property omitted from actual)
@bb/server:test:
@bb/server:test: - Expected
@bb/server:test: + Received
@bb/server:test:
@bb/server:test: {
@bb/server:test: - "results": [
@bb/server:test: - {
@bb/server:test: - "detail": StringContaining "git ls-remote failed",
@bb/server:test: - "id": "tagged",
@bb/server:test: - "outcome": "unavailable",
@bb/server:test: - },
@bb/server:test: - {
@bb/server:test: - "id": "updater",
@bb/server:test: - "outcome": "current",
@bb/server:test: - },
@bb/server:test: - ],
@bb/server:test: - "status": 200,
@bb/server:test: + "status": 422,
@bb/server:test: }
@bb/server:test:
@bb/server:test: ❯ test/services/plugins/plugin-update.test.ts:453:10
@bb/server:test: 451| status: response.status,
@bb/server:test: 452| ...(await response.json()),
@bb/server:test: 453| }).toMatchObject({
@bb/server:test: | ^
@bb/server:test: 454| status: 200,
@bb/server:test: 455| results: [
@bb/server:test:
@bb/server:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯
@bb/server:test:
@bb/server:test:
@bb/server:test: Test Files 1 failed (1)
@bb/server:test: Tests 2 failed | 31 skipped (33)
@bb/server:test: Start at 01:08:56
@bb/server:test: Duration 16.31s (transform 5.57s, setup 1.77s, import 5.45s, tests 4.08s, environment 0ms)
@bb/server:test:
5. Root cause
runInstallCommand rejects nonzero process exits, retaining the stderr tail:
if (code === 0) {
resolve();
return;
}
const tail = stderr.trim().slice(-1000);
reject(
new Error(
`${command} ${args[0]} failed (exit ${code ?? "signal"})${tail ? `: ${tail}` : ""}`,
),
);
});
The Git ref lookup and semver tag listing await that command without converting failures to an unavailable resolution. The service checkRows worker awaits resolution before persistence with no per-row error conversion:
const resolution = await resolveUpdateForRow({
row: current,
npmRun: npmRunForRow(current),
});
const checked = checkEntryFromResolution(
current.id,
installedUpdateVersion(current),
resolution,
);
persistUpdateEntry(checked);
return checked;
Any rejection escapes the lifecycle lock and rejects the Promise.all sweep. The HTTP route catches that aggregate failure and sends 422, not partial results. A successful sibling can still have its state persisted; Promise.all does not cancel its work.
Other callers: CLI outdated calls SDK checkUpdates; Settings Updates uses the update-check query; periodic checker calls the same service and logs a sweep failure. These are source-level implications, not separately observed live CLI/UI runs.
History inspection attributes the unguarded worker resolution to ba2e359bc2a; the recorded main still contains it. No linked open pull request was found in the issue timeline or the open-PR search at investigation time.
6. Proposed fix
Catch only the per-row resolveUpdateForRow call in checkRows. Convert the thrown value to the existing unavailable resolution with its message, then pass it through the normal check-entry conversion and persistence path. Leave lifecycle/database failure handling outside that catch and leave actual update execution unchanged. No public contract, protocol or stored-data shape changes are needed.
The local candidate changes two files, 55 total added/deleted text lines (16 production and 39 tests). The regression is table-driven over branch and semver selectors, checks the shared route, persisted results and recovery after the source returns. Both cases pass with the candidate repair.
7. Verification
The same agent created a second detached checkout from the recorded trusted commit, installed frozen dependencies and built the server there. Only the authored regression test was copied in; no production fix was copied. The second checkout used fresh test-created repositories and data directories and no ports.
git worktree add --detach SECOND_CHECKOUT 916d684ac23d0b0de82c09cfc7553a50287d2188 # Copy only the authored test into the same tracked test path. cd SECOND_CHECKOUT pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@bb/server pnpm exec turbo run test --filter=@bb/server -- test/services/plugins/plugin-update.test.ts -t 'keeps healthy plugin results'
The second run also failed exactly the two cases with HTTP 422 instead of 200. No correction to the root-cause finding was needed. This is a repeat by the same agent, not an independent investigation.
@bb/server:test: FAIL |@bb/server:isolated| test/services/plugins/plugin-update.test.ts > plugin update service and routes > keeps healthy plugin results when the git remote for main is unavailable
@bb/server:test: FAIL |@bb/server:isolated| test/services/plugins/plugin-update.test.ts > plugin update service and routes > keeps healthy plugin results when the git remote for semver:^1.0.0 is unavailable
@bb/server:test: AssertionError: expected { status: 422, …(1) } to match object { status: 200, results: [ …(2) ] }
@bb/server:test: (1 matching property omitted from actual)
@bb/server:test:
@bb/server:test: - Expected
@bb/server:test: + Received
@bb/server:test:
@bb/server:test: {
@bb/server:test: - "results": [
@bb/server:test: - {
@bb/server:test: - "detail": StringContaining "git ls-remote failed",
@bb/server:test: - "id": "tagged",
@bb/server:test: - "outcome": "unavailable",
@bb/server:test: - },
@bb/server:test: - {
@bb/server:test: - "id": "updater",
@bb/server:test: - "outcome": "current",
@bb/server:test: - },
@bb/server:test: - ],
@bb/server:test: - "status": 200,
@bb/server:test: + "status": 422,
@bb/server:test: }
@bb/server:test:
@bb/server:test: ❯ test/services/plugins/plugin-update.test.ts:453:10
@bb/server:test: 451| status: response.status,
@bb/server:test: 452| ...(await response.json()),
@bb/server:test: 453| }).toMatchObject({
@bb/server:test: | ^
@bb/server:test: 454| status: 200,
@bb/server:test: 455| results: [
@bb/server:test:
@bb/server:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯
@bb/server:test:
@bb/server:test:
@bb/server:test: Test Files 1 failed (1)
@bb/server:test: Tests 2 failed | 31 skipped (33)
@bb/server:test: Start at 01:09:16
@bb/server:test: Duration 11.09s (transform 5.15s, setup 1.50s, import 5.07s, tests 2.72s, environment 0ms)
@bb/server:test:
8. Related issues
No duplicate or linked open pull request was identified in the bounded searches performed for this issue. This report addresses error isolation, not release selection policy.
9. Appendix and safety limits
All issue data was treated as untrusted evidence. No issue-provided command, script, patch, branch or URL was executed or fetched. The reproduction was authored from trusted repository fixtures; it neither contacts the alleged failing remote nor requires SSH. Raw logs, the test diff and the prepared brief remain outside this public report repository. The public reproduction artifact is the complete inline test above, in accordance with this site's no-repro-files policy.
Validation performed: frozen installs and server builds in both checkouts; focused baseline twice (two expected failures each); focused candidate (two passes). The full server plugin subsystem suite passed 585 tests across 58 files with the candidate repair, and the server Turbo typecheck passed. The lint task selection had no server lint script; no separate lint success is claimed. Changed files were formatted with the existing oxfmt configuration and git diff --check passed.
Inspection commands included git log and git blame for the owner, issue field/timeline queries, open pull-request search, source reads, git diff --numstat origin/main, and git diff --check. No production instance was started, modified or stopped.