Repository navigation
perf(web-search): defer bundled provider runtime imports - #135073
Conversation
Discover bundled search providers from enabled public descriptors and load only the selected runtime when creating its tool. Preserve activation and provider selection while removing duplicate scope forwarding.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 6:04 AM ET / 10:04 UTC. ClawSweeper reviewWhat this changesThis PR lists enabled bundled web-search provider descriptors from lightweight public artifacts and loads only the selected provider runtime when its search tool is created. Merge readinessKeep open. This is a focused maintainer-authored performance refactor; current main still eagerly resolves bundled web-search runtimes, while the branch defers runtime loading through the existing plugin resolver without a supported correctness regression. Priority: P2 Review scores
Verification
How this fits togetherWeb-search requests choose configured or credential-detected provider descriptors before executing a tool. Plugin metadata supplies lightweight discovery information, while the selected provider’s runtime supplies the executable search tool. flowchart LR
A[Web search request] --> B[Provider selection]
B --> C[Public provider descriptors]
C --> D[Selected provider]
D --> E[Scoped plugin runtime]
E --> F[Search tool execution]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -9, Tests +61. Total +52 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the descriptor-to-scoped-runtime flow: it preserves manifest-first discovery and loads executable provider code only at the actual tool-creation boundary. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR optimizes plugin-runtime import fanout rather than repairing a separately reported user failure. The supplied source and focused test identify the changed resolution path. Is this the best way to solve the issue? Yes. Reusing the shared resolver’s runtime-artifact hook keeps discovery on the lightweight manifest/artifact path and retains canonical activation and runtime registration for the selected provider. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b6eee723bb1d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Reviewed the completed ClawSweeper result and its remaining maintainer-handling step. Retain the descriptor-to-scoped-runtime design: it preserves canonical activation and active-registry checks, removes eager unrelated imports, and is net-negative in production code. The 86 focused tests, complete changed checks, full build, and real API-key managed search/fetch turn pass. There are no actionable review findings to repair; landing will use the native workflow after exact-head CI is green. |
|
Merged via squash.
|
…5073) Discover bundled search providers from enabled public descriptors and load only the selected runtime when creating its tool. Preserve activation and provider selection while removing duplicate scope forwarding.
What Problem This Solves
Managed web-search discovery loads every eligible bundled provider runtime before it knows whether any provider can serve the request. A fresh built process with no configured provider imports 15 runtime plugins just to return the existing unavailable-provider error.
Why This Change Was Made
Use the existing shared resolver's runtime-artifact hook to enumerate enabled bundled search descriptors from their light public artifacts. Each descriptor creates its tool through the canonical resolver scoped to that descriptor's owner. This preserves setup-only public factories, active-registry compatibility checks, plugin activation, and external-plugin fallback behavior. Search now shares the enabled-artifact selection owner already used by web fetch.
The provider-scope helpers are folded into their one caller, deleting repeated forwarding and selection branches. Production +78/-87 (net -9); tests +62/-1 (net +61). There are no new configuration options, caches, dependencies, or persistence changes.
User Impact
Bundled provider inventory and unavailable-provider paths avoid loading unrelated executable plugins. A selected provider still executes through its runtime registration. Explicit selection, auto-detection order, credentials and SecretRefs, provider fallback, cancellation, disabled plugin entries, and mixed external installations retain their existing contracts.
Evidence