feat(plugins): narrow explicit provider loads from manifests#65259
feat(plugins): narrow explicit provider loads from manifests#65259vincentkoc merged 4 commits intomainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Greptile SummaryThis PR narrows explicit provider setup/runtime loads to use manifest activation metadata ( Three focused tests lock in the new behavior across the runtime path ( Confidence Score: 5/5Safe to merge — logic is correct, legacy fallback is preserved, and all three new code paths are test-covered. The only finding is a P2 style suggestion to flatten a nested guard into a single compound condition; no correctness, data-integrity, or security issues were found. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/plugins/providers.runtime.ts
Line: 141-145
Comment:
**Nested guard can be flattened**
The double-`if` reads as two independent decisions, but the intent is a single compound condition: return early only when both `providerPluginIds` and `explicitOwnerPluginIds` are empty. A single `&&` guard makes the invariant easier to scan and avoids a misleading `if (0 === 0) { if (...) }` shape.
```suggestion
if (providerPluginIds.length === 0 && base.explicitOwnerPluginIds.length === 0) {
return undefined;
}
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat(plugins): narrow explicit provider ..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f69e89a5b3
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cb61f4055
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f547bed660
ℹ️ 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".
| const runtimeRequestedPluginIds = | ||
| base.requestedPluginIds !== undefined | ||
| ? dedupeSortedPluginIds([...(params.onlyPluginIds ?? []), ...explicitOwnerPluginIds]) | ||
| : undefined; |
There was a problem hiding this comment.
Keep explicit provider loads scoped when owner filter empties
When explicit providerRefs resolve owner plugins that are then filtered out (for example plugins.enabled=false, entries[id].enabled=false, or allowlist exclusion), this branch sets runtimeRequestedPluginIds to an empty array. That looks scoped, but loader normalization later converts [] to undefined (normalizeScopedPluginIds), so resolveRuntimePluginRegistry/loadOpenClawPlugins can treat the request as unscoped and load all enabled provider plugins instead of none. Fresh evidence versus earlier reports: the current code uses [], but src/plugins/loader.ts still collapses that to unscoped behavior.
Useful? React with 👍 / 👎.
…w#65259) * feat(plugins): narrow explicit provider loads from manifests * fix(plugins): preserve setup trust filtering for explicit owners * fix(plugins): respect runtime owner trust and disablement * fix(plugins): preserve provider owner policy bounds
…w#65259) * feat(plugins): narrow explicit provider loads from manifests * fix(plugins): preserve setup trust filtering for explicit owners * fix(plugins): respect runtime owner trust and disablement * fix(plugins): preserve provider owner policy bounds
…w#65259) * feat(plugins): narrow explicit provider loads from manifests * fix(plugins): preserve setup trust filtering for explicit owners * fix(plugins): respect runtime owner trust and disablement * fix(plugins): preserve provider owner policy bounds
…w#65259) * feat(plugins): narrow explicit provider loads from manifests * fix(plugins): preserve setup trust filtering for explicit owners * fix(plugins): respect runtime owner trust and disablement * fix(plugins): preserve provider owner policy bounds
Summary
providerRefssetup/runtime loads still relied on older manifest ownership helpers, so descriptor-first provider activation hints were not actually narrowing those paths.providers.length > 0filter.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
activation.onProvidersorsetup.providersowners survived all the way into provider load options.Regression Test Plan (if applicable)
src/plugins/providers.test.tsUser-visible / Behavior Changes
None.
Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
activation.onProvidersorsetup.providersfor an explicit provider id without the olderproviders[]static metadata.providerRefson runtime or setup paths.onlyPluginIds/ activated config used for provider loading.Expected
Actual
Evidence
Human Verification (required)
activation.onProviders; explicit setup provider ownership viasetup.providers; legacy CLI-backend fallback viaclaude-cli; existing provider runtime tests still green.pnpm check; broad end-to-end plugin flows.Review Conversations
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations