fix(core): dedupe symlinked/junctioned skills directories during discovery - #28968
fix(core): dedupe symlinked/junctioned skills directories during discovery#28968aniruddhaadak80 wants to merge 1 commit into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where identical skills were being registered multiple times when users employed symlinks or Windows junctions to alias their skill directories. By resolving paths to their physical locations during the discovery process, the system now correctly identifies and skips redundant scans, eliminating unnecessary conflict warnings and improving startup performance. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
📊 PR Size: size/M
|
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to prevent duplicate skill discovery when directories are symlinked or junctioned (e.g., .gemini pointing to .agents). It adds a loadSkillsFromUniqueDir helper in SkillManager that resolves directories to their physical paths using fs.realpath and tracks visited paths in a Set. Additionally, corresponding unit tests are added to verify that duplicate skills are not reported under symlinked/junctioned alias directories. There are no review comments, so I have no feedback to provide.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Summary
Fixes #28944
When a user links their .gemini folder to .agents (Windows junction via \mklink /J .gemini .agents, or a symlink) to follow the open Agent Skills standard while retaining compatibility, the CLI scanned both configured entry points (.gemini/skills and .agents/skills) as if they were separate directories. Since discovery did not resolve aliases to their physical paths, identical skills were registered twice, producing duplicate-skill conflict warnings on every startup and /skills reload.
Changes
Behavior after the fix
With .gemini -> .agents: skills are discovered exactly once from the first entry point; no \Skill conflict detected: ... overriding ...\ warnings. With two genuinely distinct directories, behavior is unchanged (including existing alias precedence).
Testing
Documentation