You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CopilotRule.fromFile() determines whether a file is a "root" rule by comparing only relativeFilePath, without considering relativeDirPath. This may cause incorrect root detection in edge cases, especially in global mode.
Evidence
In src/features/rules/copilot-rule.ts around line 208:
The comparison is performed against only the file name portion (e.g., "copilot-instructions.md"), without verifying that the directory also matches. In project mode, the root file is .github/copilot-instructions.md, and in global mode it is .copilot/copilot-instructions.md. If a non-root file happens to be named copilot-instructions.md in a different directory, it could be incorrectly classified as a root rule.
Expected Behavior
Root detection should use the full relative path (directory + filename) to unambiguously distinguish root from non-root files.
Just a quick follow-up regarding cross-platform compatibility:
When using path.join(), it applies the OS-specific separator (\ on Windows, / on POSIX). This could cause the strict equality (===) check to fail if the paths.root properties were generated or stored using a different separator convention.
Given the previous forward slash to backslash conversion bug we saw in the gitignore command, and to ensure this logic works seamlessly across hybrid environments like Windows and WSL2, it might be safer to explicitly normalize the paths before comparing them.
Here is an updated snippet ensuring the separators are consistent:
Alternatively, if there is already an existing utility function for cross-platform path normalization in the repository, we can just use that. Let me know what you think!
Activity
flanny7 commentedon Apr 22, 2026
Just a quick follow-up regarding cross-platform compatibility:
When using
path.join(), it applies the OS-specific separator (\on Windows,/on POSIX). This could cause the strict equality (===) check to fail if thepaths.rootproperties were generated or stored using a different separator convention.Given the previous forward slash to backslash conversion bug we saw in the
gitignorecommand, and to ensure this logic works seamlessly across hybrid environments like Windows and WSL2, it might be safer to explicitly normalize the paths before comparing them.Here is an updated snippet ensuring the separators are consistent:
Alternatively, if there is already an existing utility function for cross-platform path normalization in the repository, we can just use that. Let me know what you think!
fix(permissions): address review findings (round 1) for kilo/augmentc…
fix(permissions): address review findings (round 2)
refactor(kilo): make subagent validate() pure and tidy schema (PR dyo…
fix(file): dedup symlink-cycle glob results and clarify symlink trust…