Repository navigation
Conversation
The composer already cancels a stale mention search request, but the server never told the plugin: the search route dropped the request signal, and providers had no way to receive one. A slow provider kept working on a query nobody wanted, and with one search per provider the newest query waited for it. The search route now forwards its request signal. Each running search gets a signal that aborts when its request disconnects, when its time box runs out, or when the plugin unloads, exposed to providers as PluginMentionSearchContext.experimental_signal. A waiting query whose request disconnects never starts, and aborting the running search lets the newest waiting query start as soon as the provider settles. Docs stops scanning further vaults once its search is aborted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/8003-fix-bound-pending-plugin-mention-searches-thr_6zafbv9pwj
branch
November 23, 2026 19:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
The composer already cancels a stale mention search request when the person types past it, but the plugin was never told.
GET /api/v1/plugins/mentions/searchdropped the request signal, andPluginMentionSearchContexthad no signal, so a provider couldn't stop. The 2s time box also stopped waiting without aborting anything. Since #8003 limited each provider to one running search, a slow provider's stale search held up the newest query until it finished on its own.What changed
apps/server/src/routes/plugins.tsforwardscontext.req.raw.signaltosearchMentions, which takes a requiredsignal.plugin-mention-search-slots.ts):invokeWrapped's existing caller-signal link, the same path RPC handlers use).PluginMentionSearchContext.experimental_signal(required; the host always supplies it). ThesearchJSDoc now describes one-search-at-a-time queueing.@get-bb/plugin-sdkis bumped to 0.6.183.docs/api_to_audit.mdentry, andbackend-ui-lifecycle.mdnow shows afetchexample and describes queueing and abort.provider.search(...)(Docs, Tasks, GitHub) now pass a signal. Third-party test code that callssearchdirectly will need the same change after upgrading the SDK.This can't interrupt a filesystem call that is already blocked (#8002). File Manager needs its own change to check the signal between directory reads.
How you verified
apps/server/test/services/plugins/plugin-mention-providers.test.ts: request disconnect aborts the provider's signal (through the HTTP route), the time box aborts it, aborting the running search starts the newest waiting query, and a waiting query whose caller left never starts. All 4 fail on main and pass here. The file passes 21/21.stops scanning further vaults once the search is aborted: fails on main's Docs plugin and passes here. Docs 50/50, Tasks 4/4.pnpm exec turbo run typecheck lint:type-awarefor@bb/server,@get-bb/plugin-sdk,bb-plugin-simple-notesandbb-plugin-tasks, plustypecheckforbb-plugin-github: all pass. The plugin authoring doc example and docs tests pass.pnpm start:worktreeserver: a QA plugin with a 400 ms provider that honours the signal, and six queries sent 120 ms apart over real HTTP, each cancelling the previous request the way the composer does. The plugin log shows each stale search aborted before the next started (start:r abort:r start:re abort:re … start:readme done:readme). The final query returned in about 400 ms, and the plugin's error count stayed at 0.Follow-up to #8003.
🤖 Generated with Claude Code