fix(plugins): discover symlinked plugin directories#72695
fix(plugins): discover symlinked plugin directories#72695ming1523 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes plugin discovery to follow symbolic links in scanned plugin root directories, resolving to file or directory type via Confidence Score: 5/5Safe to merge — the symlink resolution logic is correct and well-tested, edge cases (broken symlinks, non-file/dir targets) are handled, and existing cycle-detection via visitedDirectories + safeRealpathSync prevents infinite loops. No bugs found. resolveScannedEntryType correctly uses safeStatSync (which calls fs.statSync, a symlink-following stat) to determine the real type, the explicit continue after addCandidate in the file branch is correct, and addCandidate's existing safeRealpathSync call on rootDir means the test's rootDir assertion against the resolved real path is valid. No files require special attention. Reviews (1): Last reviewed commit: "fix(plugins): discover symlinked plugin ..." | Re-trigger Greptile |
|
Thanks for the focused fix. I landed an equivalent maintainer patch on main in 28f264034b after adapting it around the recent realpath-cache changes in the same file. The landed patch keeps the same core approach: resolve symlinked scanned entries to file/directory targets before the scanner branch, then reuse the existing discovery and safety gates. I also added coverage for global roots, workspace roots, and broken symlinks. Proof:
Closing this PR as superseded by the landed maintainer patch. |
Summary
Test
node scripts/test-projects.mjs src/plugins/discovery.test.ts