Skip to content

fix: suppress false duplicate plugin id warning for symlinked extensions#16222

Merged
steipete merged 2 commits intoopenclaw:mainfrom
shadril238:fix/suppress-false-duplicate-plugin-warning
Feb 14, 2026
Merged

fix: suppress false duplicate plugin id warning for symlinked extensions#16222
steipete merged 2 commits intoopenclaw:mainfrom
shadril238:fix/suppress-false-duplicate-plugin-warning

Conversation

@shadril238
Copy link
Contributor

@shadril238 shadril238 commented Feb 14, 2026

Problem

openclaw doctor warns about duplicate plugin id feishu even 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 a Set<string>. When two discovery candidates had different source path strings but pointed to the same physical directory (via symlinks or differing path representations), the registry falsely warned about a duplicate.

Solution

  • Changed seenIds from Set<string> to Map<string, PluginCandidate> to track the first-seen candidate per manifest ID
  • Before emitting a duplicate warning, compare fs.realpathSync() of both candidates' rootDir
  • If they resolve to the same physical directory, silently skip (false positive)
  • If they differ, emit the duplicate warning as before

Tests

Added manifest-registry.test.ts with 3 test cases:

  1. Genuine duplicates — distinct directories with same manifest id → warning emitted ✅
  2. Symlink duplicates — same directory via symlink → warning suppressed ✅
  3. Identical path duplicates — same rootDir string → warning suppressed ✅

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 doctor when the same plugin directory is discovered via both its real path and a symlink (or differing path representation). The fix changes seenIds from a Set<string> to a Map<string, PluginCandidate>, then uses fs.realpathSync() to compare physical directories before emitting a duplicate warning.

  • The core logic in manifest-registry.ts is correct: symlink/same-path duplicates are silently skipped, genuine duplicates still emit warnings, and realpathSync failures safely fall through to the warning path.
  • Three new test cases cover genuine duplicates, symlink duplicates, and identical-path duplicates — all using real filesystem operations with proper temp directory cleanup.
  • Minor style note: the symlink test silently passes (via bare return) when symlinks aren't available, rather than logging a skip reason.

Confidence Score: 5/5

  • This PR is safe to merge — it's a targeted fix with correct logic, proper error handling, and good test coverage.
  • The change is minimal and well-scoped: SetMap plus a realpathSync comparison 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.
  • No files require special attention.

Last reviewed commit: 63f1d5e

@openclaw-barnacle openclaw-barnacle bot added size: S trusted-contributor Contributor with 4+ merged PRs labels Feb 14, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

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;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@shadril238 shadril238 force-pushed the fix/suppress-false-duplicate-plugin-warning branch from 63f1d5e to ae1221f Compare February 14, 2026 13:59
@steipete steipete self-assigned this Feb 14, 2026
@steipete steipete merged commit 788ea6e into openclaw:main Feb 14, 2026
21 of 23 checks passed
@steipete
Copy link
Contributor

Landed via rebase onto main.

Thanks @shadril238!

GwonHyeok pushed a commit to learners-superpumped/openclaw that referenced this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S trusted-contributor Contributor with 4+ merged PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: doctor warns duplicate feishu plugin id but only built-in extension exists (same path printed twice)

2 participants

Comments