fix(plugins): centralize explicit plugin scope handling#65298
fix(plugins): centralize explicit plugin scope handling#65298vincentkoc merged 8 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1c1a3efde
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return deps.mapRegistryProviders({ | ||
| registry: runtimeRegistry, | ||
| onlyPluginIds: params.onlyPluginIds, | ||
| onlyPluginIds: loadOptions?.onlyPluginIds, |
There was a problem hiding this comment.
Preserve
onlyPluginIds when config is omitted
When resolveRuntimeWebProviders is called with config unset but an explicit onlyPluginIds scope, this path now drops the scope and returns providers from the full active runtime registry. loadOptions is intentionally undefined in that case, so onlyPluginIds: loadOptions?.onlyPluginIds becomes undefined and no filtering happens. This is a regression from the previous behavior (which filtered by params.onlyPluginIds) and can surface extra providers whenever callers rely on scoped runtime resolution without passing config.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR centralizes explicit plugin scope handling into a new Confidence Score: 5/5Safe to merge — the scope helper is correctly designed, all changed paths preserve the undefined/[] distinction, and regression tests cover the key scenarios end-to-end. No P0 or P1 findings. The No files require special attention. The helper design and callsite usage are consistent throughout. Reviews (1): Last reviewed commit: "Merge branch 'main' into feat/plugins-sc..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86797cb2c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
* fix(plugins): centralize explicit plugin scope handling * fix(plugins): preserve explicit empty web scopes * fix(plugins): preserve runtime web provider scopes without config * fix(plugins): preserve web provider runtime filtering * fix(plugins): preserve scoped web runtime fallback * fix(plugins): harden plugin scope normalization
* fix(plugins): centralize explicit plugin scope handling * fix(plugins): preserve explicit empty web scopes * fix(plugins): preserve runtime web provider scopes without config * fix(plugins): preserve web provider runtime filtering * fix(plugins): preserve scoped web runtime fallback * fix(plugins): harden plugin scope normalization
* fix(plugins): centralize explicit plugin scope handling * fix(plugins): preserve explicit empty web scopes * fix(plugins): preserve runtime web provider scopes without config * fix(plugins): preserve web provider runtime filtering * fix(plugins): preserve scoped web runtime fallback * fix(plugins): harden plugin scope normalization
Summary
[]vsundefinedcould drift back into the same behavior outside the first main-path fix.plugin-scopehelper and moved loader, provider, runtime metadata, and web-provider cache/scope handling onto it.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
onlyPluginIds: []the same asonlyPluginIds: undefined.Regression Test Plan (if applicable)
src/plugins/runtime/runtime-registry-loader.test.ts,src/plugins/runtime/metadata-registry-loader.test.ts,src/plugins/providers.test.ts,src/plugins/web-provider-resolution-shared.test.tssrc/plugins/loader.runtime-registry.test.tscovers adjacent loader/runtime registry behavior.User-visible / Behavior Changes
None.
Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
onlyPluginIds: [].pnpm build.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
undefinedvs[], scoped-empty cache keys, helper set creation, explicit empty forwarding through metadata/runtime loaders.pnpm test, remote CI, or third-party plugin ecosystems.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
undefinedhandling in hot paths.undefinedsemantics intact, added explicit empty-scope regressions, and ranpnpm buildbecause these are loader/runtime boundaries.AI assistance
pnpm test:serial src/plugins/runtime/runtime-registry-loader.test.ts src/plugins/runtime/metadata-registry-loader.test.ts src/plugins/providers.test.ts src/plugins/web-provider-resolution-shared.test.tspnpm test:serial src/plugins/loader.test.ts src/plugins/loader.runtime-registry.test.ts src/plugins/provider-runtime.test.tspnpm lint -- src/plugins/plugin-scope.ts src/plugins/loader.ts src/plugins/providers.ts src/plugins/providers.runtime.ts src/plugins/runtime/runtime-registry-loader.ts src/plugins/runtime/metadata-registry-loader.ts src/plugins/provider-runtime.ts src/plugins/web-provider-resolution-shared.ts src/plugins/providers.test.ts src/plugins/runtime/runtime-registry-loader.test.ts src/plugins/runtime/metadata-registry-loader.test.ts src/plugins/web-provider-resolution-shared.test.ts,pnpm build