#20499: test(plugins): add bundled+config duplicate discovery regression
size: XS
Cluster:
Plugin Management Enhancements
## Summary
Describe the problem and fix in 2–5 bullets:
- Problem:
- Why it matters:
- What changed:
- What did NOT change (scope boundary):
## Change Type (select all)
- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Docs
- [ ] Security hardening
- [ ] Chore/infra
## Scope (select all touched areas)
- [ ] Gateway / orchestration
- [ ] Skills / tool execution
- [ ] Auth / tokens
- [ ] Memory / storage
- [ ] Integrations
- [ ] API / contracts
- [ ] UI / DX
- [ ] CI/CD / infra
## Linked Issue/PR
- Closes #
- Related #
## User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write `None`.
## Security Impact (required)
- New permissions/capabilities? (`Yes/No`)
- Secrets/tokens handling changed? (`Yes/No`)
- New/changed network calls? (`Yes/No`)
- Command/tool execution surface changed? (`Yes/No`)
- Data access scope changed? (`Yes/No`)
- If any `Yes`, explain risk + mitigation:
## Repro + Verification
### Environment
- OS:
- Runtime/container:
- Model/provider:
- Integration/channel (if any):
- Relevant config (redacted):
### Steps
1.
2.
3.
### Expected
-
### Actual
-
## Evidence
Attach at least one:
- [ ] Failing test/log before + passing after
- [ ] Trace/log snippets
- [ ] Screenshot/recording
- [ ] Perf numbers (if relevant)
## Human Verification (required)
What you personally verified (not just CI), and how:
- Verified scenarios:
- Edge cases checked:
- What you did **not** verify:
## Compatibility / Migration
- Backward compatible? (`Yes/No`)
- Config/env changes? (`Yes/No`)
- Migration needed? (`Yes/No`)
- If yes, exact upgrade steps:
## Failure Recovery (if this breaks)
- How to disable/revert this change quickly:
- Files/config to restore:
- Known bad symptoms reviewers should watch for:
## Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write `None`.
- Risk:
- Mitigation:
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds a regression test to verify that duplicate plugin warnings are properly suppressed when the same plugin directory is discovered through both bundled plugin discovery (via `OPENCLAW_BUNDLED_PLUGINS_DIR`) and explicit config load paths.
- Adds `writeIndex()` helper function to create a minimal plugin index file
- New test sets up a scenario where bundled discovery and config paths point to the same physical directory
- Verifies that only one plugin is registered with no duplicate warnings
- Confirms precedence: config origin takes priority over bundled origin
- Properly cleans up environment variable after test execution
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The changes are purely additive test code with no production impact. The new test follows existing patterns, properly cleans up resources, and tests a specific regression scenario for duplicate plugin detection logic.
- No files require special attention
<sub>Last reviewed commit: a42c5ee</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#21871: fix(plugins): suppress false duplicate warning when user-installed ...
by hydro13 · 2026-02-20
83.2%
#18966: fix(config): downgrade unknown bundled plugin references to warnings
by moxunjinmu · 2026-02-17
81.5%
#20424: Fix plugin extension path traversal in discovery/install
by markmusson · 2026-02-18
79.7%
#21660: fix(plugins): require explicit allowlist for non-bundled plugins
by AI-Reviewer-QS · 2026-02-20
79.6%
#20889: fix: suppress duplicate warning for virtual auto-enabled entries
by akramcodez · 2026-02-19
79.3%
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
78.9%
#12048: fix: deduplicate config warnings to log once instead of on every re...
by mcaxtr · 2026-02-08
78.6%
#7204: Plugins: default non-bundled plugins off
by veganmosfet · 2026-02-02
78.0%
#12084: fix: prevent false duplicate plugin warning for bundled channel plu...
by shadril238 · 2026-02-08
77.9%
#7090: fix: plugin install uses manifest ID for folder name (#2796)
by dial481 · 2026-02-02
77.0%