#18730: fix(plugins): suppress duplicate ID warnings for intentional origin overrides
size: S
## Summary
Fixes false-positive duplicate plugin ID warnings that appeared when workspace/global extensions intentionally override bundled plugins. The system now only warns when true conflicts occur (same-precedence duplicates).
## Problem
Users saw warnings like:
```
duplicate plugin id detected; later plugin may be overridden (workspace/matrix/index.ts)
```
Even though this was expected behavior — workspace/global extensions intentionally override bundled plugins based on precedence.
## Solution
Modified `src/plugins/manifest-registry.ts` to distinguish between:
- **Intentional overrides (different precedence)**: No warning
- Example: bundled "matrix" + workspace "matrix" = workspace wins ✅
- **True conflicts (same precedence)**: Warning issued
- Example: global "matrix" + global "matrix" = conflict ⚠️
Precedence ranking: `config > workspace > global > bundled`
## Changes
### Code Changes
**File**: `src/plugins/manifest-registry.ts` (lines 232-246)
Added precedence-aware duplicate detection:
```typescript
const samePrecedence = PLUGIN_ORIGIN_RANK[candidate.origin] === PLUGIN_ORIGIN_RANK[existing.candidate.origin];
if (samePrecedence) {
diagnostics.push({...});
}
```
### Test Changes
**File**: `src/plugins/manifest-registry.test.ts`
- Updated test: different-precedence (bundled + global) → expects 0 warnings
- Added test: same-precedence (global + global) → expects 1 warning
## Testing Strategy
| Scenario | Origins | Expected Warning |
|----------|---------|------------------|
| Different precedence | bundled + global | ❌ No warning |
| Same precedence | global + global | ✅ Warn |
| Same physical dir | symlinked paths | ❌ No warning |
| Identical rootDir | same path, different source | ❌ No warning |
## Validation
- [x] TypeScript compilation passes
- [x] Logic verified against precedence: `config(0) > workspace(1) > global(2) > bundled(3)`
- [x] Both test scenarios cover the new behavior
⚠️ **Note**: Full `pnpm test` couldn't run due to vendor/a2ui submodule dependency requiring native build tools not available in sandbox. However:
- Code syntax validated
- Logic matches Greptile-reviewed PR #18418 approach
- Tests cover both pass/fail cases
## Related
Closes #18330
---
## 🤖 AI Assistance Disclosure
This PR is **AI-assisted** using Claude via OpenClaw.
- **Testing level**: Logic validated, TypeScript syntax checked, test cases written. Full build/test blocked by canvas dependency.
- **I understand what the code does**: The change adds a precedence check before emitting duplicate warnings. Higher-precedence origins (workspace, global) intentionally override lower ones (bundled), so warnings should only fire for same-precedence conflicts.
- **Prompts/session logs**: Multi-step implementation covering source analysis, code changes, and test updates.
Most Similar PRs
#18418: fix(plugins): improve duplicate plugin ID warning with actionable g...
by BinHPdev · 2026-02-16
79.4%
#21871: fix(plugins): suppress false duplicate warning when user-installed ...
by hydro13 · 2026-02-20
78.5%
#20889: fix: suppress duplicate warning for virtual auto-enabled entries
by akramcodez · 2026-02-19
72.9%
#12084: fix: prevent false duplicate plugin warning for bundled channel plu...
by shadril238 · 2026-02-08
71.0%
#11454: fix(plugins): remove workspace:* from extension dependencies
by AnonO6 · 2026-02-07
70.7%
#20822: fix(config): deduplicate config warnings to prevent log spam
by marcodelpin · 2026-02-19
70.4%
#20499: test(plugins): add bundled+config duplicate discovery regression
by dcol91863 · 2026-02-19
70.4%
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
69.0%
#22577: fix(feishu): use senderKey fallback for DM session isolation
by leesonchen · 2026-02-21
67.9%
#19941: fix(nostr): move openclaw from devDependencies to peerDependencies
by AustinEral · 2026-02-18
67.5%