Describe the bug
On Windows, COPILOT_CUSTOM_INSTRUCTIONS_DIRS is set with backslash-separated paths (Windows default). /env shows the same instruction file listed twice under "Custom Instructions" -- once with backslashes, once with forward slashes:
- <repo-a>\.github\instructions\personal.instructions.md
- <repo-b>/.github/copilot-instructions.md
- <repo-a>/.github/instructions/personal.instructions.md
Entries 1 and 3 point to the exact same file on disk, just discovered via two different code paths that normalize separators differently (one appears to preserve the raw env-var value with \, the other appears to come from a separate discovery mechanism -- e.g. git-root walk -- that normalizes to /). Deduplication apparently compares raw path strings rather than normalized/resolved paths, so the same file''s content is loaded and injected into context twice.
Affected version
GitHub Copilot CLI 1.0.82
Steps to reproduce
- On Windows, set
COPILOT_CUSTOM_INSTRUCTIONS_DIRS to an absolute backslash path pointing at a directory containing an *.instructions.md file, inside a git repo.
- Start a session in that repo (or a subdirectory).
- Run
/env.
- Observe the same file listed twice under "Custom Instructions", once with
\, once with /.
Expected behavior
Path deduplication should normalize separators (and ideally resolve to a canonical/absolute path) before comparing, so the same file is only loaded and injected once.
Additional context
Windows 11. Confirmed via /env output; env var itself only contains one (backslash) entry for the affected directory, so the duplicate entry is generated internally by the CLI''s discovery logic, not by the env var configuration.
Describe the bug
On Windows,
COPILOT_CUSTOM_INSTRUCTIONS_DIRSis set with backslash-separated paths (Windows default)./envshows the same instruction file listed twice under "Custom Instructions" -- once with backslashes, once with forward slashes:Entries 1 and 3 point to the exact same file on disk, just discovered via two different code paths that normalize separators differently (one appears to preserve the raw env-var value with
\, the other appears to come from a separate discovery mechanism -- e.g. git-root walk -- that normalizes to/). Deduplication apparently compares raw path strings rather than normalized/resolved paths, so the same file''s content is loaded and injected into context twice.Affected version
GitHub Copilot CLI 1.0.82
Steps to reproduce
COPILOT_CUSTOM_INSTRUCTIONS_DIRSto an absolute backslash path pointing at a directory containing an*.instructions.mdfile, inside a git repo./env.\, once with/.Expected behavior
Path deduplication should normalize separators (and ideally resolve to a canonical/absolute path) before comparing, so the same file is only loaded and injected once.
Additional context
Windows 11. Confirmed via
/envoutput; env var itself only contains one (backslash) entry for the affected directory, so the duplicate entry is generated internally by the CLI''s discovery logic, not by the env var configuration.