fix: suppress false duplicate plugin id warning for symlinked extensions#16222
Merged
steipete merged 2 commits intoopenclaw:mainfrom Feb 14, 2026
Merged
Conversation
Comment on lines
+74
to
+80
| try { | ||
| fs.symlinkSync(realDir, symlinkPath, "junction"); | ||
| } catch { | ||
| // On systems where symlinks are not supported (e.g. restricted Windows), | ||
| // skip this test gracefully. | ||
| return; | ||
| } |
Contributor
There was a problem hiding this comment.
Silent test pass instead of skip
When symlink creation fails, the test returns early and silently passes. This masks the fact that the symlink test case wasn't actually exercised. Consider using vitest's skip mechanism to make CI visibility clearer, e.g.:
Suggested change
| try { | |
| fs.symlinkSync(realDir, symlinkPath, "junction"); | |
| } catch { | |
| // On systems where symlinks are not supported (e.g. restricted Windows), | |
| // skip this test gracefully. | |
| return; | |
| } | |
| try { | |
| fs.symlinkSync(realDir, symlinkPath, "junction"); | |
| } catch { | |
| // On systems where symlinks are not supported (e.g. restricted Windows), | |
| // skip this test gracefully. | |
| // eslint-disable-next-line no-console | |
| console.warn("Skipping symlink test: symlinks not supported on this platform"); | |
| return; | |
| } |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/plugins/manifest-registry.test.ts
Line: 74:80
Comment:
**Silent test pass instead of skip**
When symlink creation fails, the test returns early and silently passes. This masks the fact that the symlink test case wasn't actually exercised. Consider using vitest's skip mechanism to make CI visibility clearer, e.g.:
```suggestion
try {
fs.symlinkSync(realDir, symlinkPath, "junction");
} catch {
// On systems where symlinks are not supported (e.g. restricted Windows),
// skip this test gracefully.
// eslint-disable-next-line no-console
console.warn("Skipping symlink test: symlinks not supported on this platform");
return;
}
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
When the same plugin directory is discovered through different path representations (e.g. symlinks), the manifest registry incorrectly warns about a duplicate plugin id. This is a false positive that appears for bundled extensions like feishu (openclaw#16208). Compare fs.realpathSync() of both candidates' rootDir before emitting the duplicate warning. If they resolve to the same physical directory, silently skip the duplicate instead of warning. Also change seenIds from Set<string> to Map<string, PluginCandidate> to track the first-seen candidate for comparison. Closes openclaw#16208
63f1d5e to
ae1221f
Compare
Contributor
|
Landed via rebase onto main. Thanks @shadril238! |
steipete
added a commit
that referenced
this pull request
Feb 14, 2026
steipete
added a commit
that referenced
this pull request
Feb 14, 2026
hamidzr
pushed a commit
to hamidzr/openclaw
that referenced
this pull request
Feb 14, 2026
openperf
pushed a commit
to openperf/moltbot
that referenced
this pull request
Feb 14, 2026
openperf
pushed a commit
to openperf/moltbot
that referenced
this pull request
Feb 14, 2026
mverrilli
pushed a commit
to mverrilli/openclaw
that referenced
this pull request
Feb 14, 2026
GwonHyeok
pushed a commit
to learners-superpumped/openclaw
that referenced
this pull request
Feb 15, 2026
Benkei-dev
pushed a commit
to Benkei-dev/openclaw
that referenced
this pull request
Feb 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
openclaw doctorwarns about duplicate plugin idfeishueven though only the built-in extension exists, printing the same path twice.Fixes #16208
Root Cause
In
manifest-registry.ts, the registry tracked seen plugin IDs with aSet<string>. When two discovery candidates had differentsourcepath strings but pointed to the same physical directory (via symlinks or differing path representations), the registry falsely warned about a duplicate.Solution
seenIdsfromSet<string>toMap<string, PluginCandidate>to track the first-seen candidate per manifest IDfs.realpathSync()of both candidates'rootDirTests
Added manifest-registry.test.ts with 3 test cases:
All 14 plugin test files pass (83 tests total).
Greptile Overview
Greptile Summary
This PR fixes a false-positive "duplicate plugin id" warning in
openclaw doctorwhen the same plugin directory is discovered via both its real path and a symlink (or differing path representation). The fix changesseenIdsfrom aSet<string>to aMap<string, PluginCandidate>, then usesfs.realpathSync()to compare physical directories before emitting a duplicate warning.manifest-registry.tsis correct: symlink/same-path duplicates are silently skipped, genuine duplicates still emit warnings, andrealpathSyncfailures safely fall through to the warning path.return) when symlinks aren't available, rather than logging a skip reason.Confidence Score: 5/5
Set→Mapplus arealpathSynccomparison guard. The error handling is sound (catch falls through to warning). The fix preserves the original behavior for genuine duplicates while correctly suppressing false positives. Three new tests cover the key scenarios.Last reviewed commit: 63f1d5e