Repository navigation
Speed up model and reasoning picker loading - #1810
Conversation
| dirtyProjectCommandCatalogQueries, | ||
| dirtyPluginManagementQueries, | ||
| dirtySystemProviderQueries, // Provider plugins add/remove picker entries. | ||
| dirtySystemExecutionOptionQueries, // Refresh a boot-time partial provider roster. |
There was a problem hiding this comment.
🚨 slopcop/review — Unrelated plugin changes now refetch every active model picker.
This broad execution-option invalidation repairs the partial startup roster. It also runs for any plugin reload or status change. Each active query can start another provider model probe. Please narrow this action to provider roster changes, or add a targeted settlement event. Add a test that an unrelated plugin change does not refetch picker data.
| timeoutMs: CHILD_REQUEST_TIMEOUT_MS, | ||
| }), | ||
| ); | ||
| const connection = await getModelListConnection(); |
There was a problem hiding this comment.
🚨 slopcop/review — A failed model request leaves the cached child reusable.
connection.request can time out or reject malformed output without marking this connection as exited. The next picker refresh then reuses the same child and can repeat the full timeout. Please clear and stop this cached child after a request failure. Add a test that proves the next request creates a healthy child.
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Plain-English summary
This PR lets the picker answer when its selected provider becomes ready. It also keeps one Codex helper alive for later model requests.
The warm backend request improved from 5.52 seconds to 0.15 seconds in my local check.
Findings
-
High: A timed-out or invalid
model/listresponse leaves the helper cached. Later picker requests reuse that child and can repeat the full timeout. Stop and clear the cached child after any request failure. Add a recovery test. -
Medium: Every plugin change now invalidates all active execution-option queries. An unrelated plugin reload can start new model and ACP probes. Use a provider-specific change signal, or narrow the invalidation scope.
I left an inline comment for each finding.
Review details
The server and daemon ownership split remains correct. This PR does not change a wire contract, so it does not need a protocol version increase.
I found a duplicate ACP-registration scan in the registry and bridge-launch paths. A shared registry method could remove that low-risk duplicate.
I found no new authentication, authorization, data exposure, or forged-capability issue. The retained-child timeout is the main denial-of-service risk.
Checks
- GitHub CI passes.
- Typechecks pass for the server, app, and Codex provider plugin.
- The Codex provider suite passes 165 tests.
- The frontend cache suite passes 43 tests.
- The focused server suites pass 45 tests.
git diff --checkpasses.- The direct picker backend returned seven Codex models without an error.
The browser app shell loaded. The worktree Vite API proxy hung, so I could not complete the visual picker interaction.
This is a comment-only review. I did not approve the PR or request changes. I recommend a fix for the cached-child recovery before merge.
## Summary - retire the reusable Codex model-list child after request or catalog validation failures - force the next picker refresh to initialize a fresh app-server process - cover failure recovery while preserving successful child reuse Addresses the reliability finding from #1810 (comment). ## Testing - `pnpm exec turbo run test --filter=bb-plugin-provider-codex --force` - `pnpm exec turbo run typecheck --filter=bb-plugin-provider-codex` - `pnpm exec prettier --check plugins/provider-codex/src/bridge/bridge.ts plugins/provider-codex/src/bridge/bridge.model-list.test.ts plugins/provider-codex/src/bridge/fake-codex-app-server.mjs` > AGENT GENERATED: by GPT-5
## Summary - add a provider-registration-specific realtime change kind - coalesce registry mutations at plugin lifecycle boundaries using a monotonic registration revision - keep provider and execution-option caches intact for unrelated plugin changes - invalidate picker caches when a provider is installed, removed, enabled, disabled, or reloaded 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.ts` - `pnpm exec turbo run typecheck --filter=@bb/domain --filter=@bb/server --filter=@bb/app` - `pnpm exec turbo run typecheck --filter=@get-bb/plugin-sdk` - `pnpm 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. > AGENT GENERATED: by GPT-5
Summary
Testing
pnpm exec turbo run test --filter=@bb/server -- --run test/providers/provider-registry.test.ts test/system/execution-options.test.tspnpm exec turbo run test --filter=bb-plugin-provider-codex --forcepnpm exec turbo run test --filter=@bb/app -- --run src/hooks/realtime-cache-effects.test.tspnpm exec turbo run typecheck --filter=@bb/server --filter=@bb/app --filter=bb-plugin-provider-codexpnpm exec turbo run lint --filter=@bb/app(0 errors; existing warnings remain)