Repository navigation
Description
Summary
A plugin mention provider can time out while its underlying work stays pending. Each subsequent request starts another call to the same provider. Repeated File Manager searches during a macOS filesystem authorization stall can therefore occupy every libuv filesystem worker and leave the server unable to complete other filesystem-dependent work.
Versions and environment
- Reproduced the overlapping-call mechanism on upstream source commit
35a03bbbb3f4d8dc814c1a152db5a463102b4250in a disposable macOS 26.6.2 arm64 VM, Node 22.19.0, pnpm 9.15.0. - Original incident: packaged BB 0.49.0, Node 26.8.2, macOS 27.2.1, File Manager 0.7.3. The server process remained alive. Its four libuv filesystem workers were sampled blocked in
scandir → __opendir2 → open$NOCANCEL → __open_nocancel. macOS logs at the onset show iCloud/CloudDocs privacy authorization for that process. - No agent inference is involved. The original OS authorization hang was not deliberately recreated, and its exact directory remains unknown.
Steps to reproduce
The regression fixture loads a real plugin into a real migrated SQLite-backed plugin service. Its search awaits a manually controlled Promise. It starts two overlapping searches, waits beyond the response timeout, and sends five more requests. A sibling provider answers immediately.
In a fresh disposable checkout:
git clone --branch fix/mention-search-inflight-guard https://github.com/csells/bb.git bb-mention-repro
cd bb-mention-repro
pnpm install --frozen-lockfile
git show 35a03bbbb3f4d8dc814c1a152db5a463102b4250:apps/server/src/services/plugins/plugin-service.ts > apps/server/src/services/plugins/plugin-service.ts
pnpm exec turbo run test --filter=@bb/server -- test/services/plugins/plugin-mention-providers.test.tsThe checkout retains the new regression tests but runs the upstream service implementation. Both late-fulfillment and late-rejection cases fail. Restoring the branch's service implementation makes all 16 tests in the file pass.
Expected vs actual
Expected: one underlying search remains in flight for a provider registration, including after the HTTP/search response times out. Other providers continue to answer. The provider becomes available again when its work resolves or rejects.
Actual assertion output (ANSI coloring removed):
- "context": "1",
+ "context": "7",
Tests 2 failed | 14 passed (16)
The fixture exposes its underlying invocation count through its resolver; it measures actual provider calls rather than request timeout durations.
Evidence
- Upstream timeout code races the search Promise against a timeout without limiting subsequent calls.
- Regression and containment fix; PR Prevent overlapping plugin mention searches after timeouts #8001.
- Originating investigation: BB thread
thr_rt9ugdiguz; incident stack sample, OS logs, red/green logs, and staging evidence retained in that thread's storage.
What was ruled out
- Still reproduces with the upstream service at the commit above and a fresh test database.
- Search and typeahead stall on full-text SQL, repeated file discovery, and slow mention providers #4413 covers provider-result latency, SQL, and repeated file discovery; this report concerns calls that remain pending after the response deadline and accumulate across requests.
- Path search on a large workspace stalls the host daemon past its lease, server drops the local host #5385 concerned CPU-bound host-daemon path ranking and heartbeat loss. The original incident here had an idle server event loop and all four filesystem workers blocked in directory opens.
- A Promise timeout alone does not stop the underlying work. The proposed containment does not cancel a blocked OS syscall or isolate arbitrary plugins in subprocesses.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 22, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotplugins,perf.partial-repro.origin/main, repeated in a second clean checkout. The macOS authorization stall and filesystem-worker exhaustion were not recreated.Abort mention searches the person has typed past (#8047)