Repository navigation
Invalidate model pickers only for provider changes - #1817
Conversation
|
🚨 SLOP COP 🚨 · I am the SlopCop. I am reviewing this pull request for security, code quality, performance, architecture, and end-to-end behavior. |
| export const SYSTEM_CHANGE_KINDS = [ | ||
| "config-changed", | ||
| "plugins-changed", | ||
| "provider-registrations-changed", |
There was a problem hiding this comment.
🚨 slopcop/review — Regenerate the embedded plugin SDK template after this contract change. The committed packages/templates/src/generated/plugin-sdk-dts.generated.ts still lacks this enum member. node packages/templates/scripts/generate-templates.mjs --check fails, and generated template consumers receive the stale realtime contract until the file is regenerated.
| deps.hub.notifySystem(["plugins-changed"]); | ||
| const changes: SystemChangeKind[] = ["plugins-changed"]; | ||
| const providerRegistrationRevision = | ||
| deps.providerRegistry?.getRegistrationRevision(); |
There was a problem hiding this comment.
🚨 slopcop/review — Non-blocking architecture note: the registry mutation does not own this notification. experimental_registerProvider supports registration after activation, and its returned handle can dispose that registration later. Those changes increment the revision, but no event reaches open pickers until another plugin lifecycle or settings event calls this function. This delay existed before this pull request, so it is not a new regression. A registry callback or subscription would remove the cross-service polling and cover live register/dispose changes; a focused test would document the intended behavior.
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Plain-English summary
This change stops BB from reloading provider and model lists after every plugin update. It adds a specific signal for provider registration changes.
BB now reloads those lists when a provider plugin adds or removes a provider.
Review result
I found one issue that must be fixed before merge.
- The generated SDK template is stale.
The source type includes provider-registrations-changed, but the plugin scaffold template still contains the old type.
node packages/templates/scripts/generate-templates.mjs --check exits with code 1. Run the generator and commit its output.
See the inline finding.
Architecture note
The registry owns the provider state. The plugin service checks a revision only when it sends another plugin notice.
Live register or dispose actions can wait for a later plugin event before the browser receives an update. This limitation existed before this change.
A registry event callback could simplify this design and cover live changes. See the inline note.
I found no duplicate revision logic elsewhere.
Other checks
-
Security review found no issue.
-
Performance review found no issue. The change reduces unnecessary provider and execution-option requests.
-
GitHub CI passes all current required jobs.
-
The application realtime test passed all 44 tests.
-
The focused provider tests passed. A wider local run had one unrelated timeout during heavy shared-worktree use.
-
Browser tests showed live add and remove actions for Echo Agent in an open picker.
-
An unrelated plugin enable action caused no provider or execution-option request.
-
git diff --checkpassed, and the review worktree is clean.
The independent GPT-5.6-Sol review gate found the stale file and returned REQUEST CHANGES. I posted this GitHub review as a comment only.
…ed (#1817) Co-Authored-By: Claude <[email protected]>
Summary
Addresses the performance finding from #1810 (comment).
Testing
pnpm exec turbo run test --filter=@bb/server -- --run test/services/plugins/plugin-service.test.ts test/services/plugins/plugin-provider-registration.test.ts -t "broadcasts plugins-changed|adds the provider"pnpm exec turbo run test --filter=@bb/app -- --run src/hooks/realtime-cache-effects.test.tspnpm exec turbo run typecheck --filter=@bb/domain --filter=@bb/server --filter=@bb/apppnpm exec turbo run typecheck --filter=@get-bb/plugin-sdkpnpm exec turbo run lint --filter=@bb/app --filter=@bb/server --filter=@bb/domain(0 errors; existing warnings remain)This changes only the server-to-app realtime event contract; the host-daemon protocol is unchanged.