Skip to content

Prevent overlapping plugin mention searches after timeouts - #8001

Closed
csells wants to merge 1 commit into
get-bb:mainfrom
csells:fix/mention-search-inflight-guard
Closed

csells wants to merge 1 commit into
get-bb:mainfrom
csells:fix/mention-search-inflight-guard

Conversation

@csells

@csells csells commented Nov 22, 2026 •

Copy link
Copy Markdown

Human comments

What was wrong

Fixes #8002 — Timed-out plugin mention searches accumulate work and can exhaust filesystem workers.

Plugin mention-search timeouts stopped waiting for the result but allowed the underlying work to continue. Subsequent requests started more calls to the same provider. A macOS incident on BB 0.49.0 left all four libuv filesystem workers blocked opening directories after File Manager searches encountered iCloud/CloudDocs authorization. Repeated calls to one stuck provider could consume the entire worker pool even though each HTTP search timed out.

What changed

Keep one active search per mention-provider registration until the underlying operation actually settles, including after the response timeout. Requests that encounter a busy provider omit that provider while allowing other registrations to answer. Resolve and reject both release the guard; registrations from reloaded plugins have separate identities. Document this behavior in the SDK declaration. No wire, CLI, configuration, or public API signature changes.

This contains repeated calls to the same provider; it does not cancel a blocked OS syscall or isolate all plugin execution in subprocesses.

How you verified

  • Added two integration regressions using real plugin loading and SQLite: overlapping searches, retries after timeout, unaffected sibling providers, and recovery after late fulfillment/rejection. On upstream both failed with seven underlying calls instead of one; with this change all 16 tests in the file pass.
  • Disposable macOS arm64 VM, Node 22.19.0: pnpm exec turbo run test --filter=@bb/server -- test/services/plugins/plugin-mention-providers.test.ts.
  • Same VM: pnpm exec turbo run build typecheck --filter=@bb/server --filter=@bb/app --filter=bb-app --filter=@bb/host-daemon --filter=@bb/cli — 69 tasks passed.
  • Ran the complete packaged candidate in the VM with a separate data directory and ports. Installed File Manager 0.7.3 and verified the real mention-search HTTP endpoint returns README files from the candidate source checkout and real VM filesystem. CLI status and HTTP UI entry point passed.
  • Browser smoke: the packaged candidate renders onboarding without JavaScript page errors. Agent execution is unverified because the disposable VM has no signed-in model provider.
  • Formatting and diff checks passed. The original iCloud authorization hang was not deliberately recreated; its exact directory remains unknown. No existing Apple or model-provider credentials were copied into the VM.

AGENT GENERATED

@github-actions github-actions Bot added needs-approval PR author is not on the approved contributor list needs-issue PR does not close an open issue labels Nov 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the pull request, @csells. It was closed automatically because it does not meet the requirements below yet. This is an automated check, not a review of the change.

Contributor approval. bb reviews pull requests only from approved contributors, and you are not on the list yet. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ), post a link to your pull request, and explain what it changes and why. A maintainer then adds you to the list and reopens the pull request.

Linked issue. Every pull request must close an open issue in this repository. The issue keeps the problem tracked even if this pull request closes or we take a different approach. Open an issue for the change, or find an existing one, and add Fixes #<number> to the pull request description. Feature requests and UI changes need a maintainer's sign-off on the issue first. Link the issue before you ask for approval.

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-approval PR author is not on the approved contributor list needs-issue PR does not close an open issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timed-out plugin mention searches accumulate work and can exhaust filesystem workers

1 participant