Describe the bug
In a Copilot agent session hosted by VS Code on Windows, every personal instructions file under ~/.copilot/instructions is injected into the session's system message twice. A description-only file (no applyTo) has its whole body inlined twice; a file with applyTo gets two index rows.
The host starts the runtime with COPILOT_HOME=c:\Users\<user>\.copilot, with a lowercase drive letter, while native discovery sees the same directory as C:\Users\<user>\.copilot\instructions. The two locations differ only in drive-letter case, and deduplication appears to treat them as different files.
This looks like the drive-letter-case sibling of #4702, which was the \ vs / separator variant. It still reproduces on a runtime built after that fix.
Affected version
- VS Code 1.140.0 (agent host)
@github/copilot-sdk-win32-x64 1.0.15-preview.4, copilot-runtime.exe 1.0.89-7
- Windows 11
The standalone CLI (@github/copilot 1.0.40) run against the same directory loads each file once.
Steps to reproduce
- Create
%USERPROFILE%\.copilot\instructions\probe.instructions.md with front matter name: "Probe" and description: "probe", no applyTo, and a one-line body.
- Start a new Copilot agent session from VS Code.
- Open
~/.copilot/session-state/<session-id>/events.jsonl, take the first system.message event, and count occurrences of name: "Probe" in its content.
- In a shell tool of that session, print
COPILOT_HOME.
Observed: the count is 2, and COPILOT_HOME is c:\Users\<user>\.copilot.
Expected behavior
Instruction directories and files are deduplicated by canonical path — case-insensitively on Windows, after normalizing separators — so each file is loaded once.
Additional context
With four description-only personal instruction files, the duplicate costs about 25K characters of system message in every session. Two workarounds were tried and neither helps: a subdirectory of ~/.copilot/instructions is duplicated the same way, and COPILOT_CUSTOM_INSTRUCTIONS_DIRS loads the files as external repository instructions rather than personal ones.
Describe the bug
In a Copilot agent session hosted by VS Code on Windows, every personal instructions file under
~/.copilot/instructionsis injected into the session's system message twice. A description-only file (noapplyTo) has its whole body inlined twice; a file withapplyTogets two index rows.The host starts the runtime with
COPILOT_HOME=c:\Users\<user>\.copilot, with a lowercase drive letter, while native discovery sees the same directory asC:\Users\<user>\.copilot\instructions. The two locations differ only in drive-letter case, and deduplication appears to treat them as different files.This looks like the drive-letter-case sibling of #4702, which was the
\vs/separator variant. It still reproduces on a runtime built after that fix.Affected version
@github/copilot-sdk-win32-x641.0.15-preview.4,copilot-runtime.exe1.0.89-7The standalone CLI (
@github/copilot1.0.40) run against the same directory loads each file once.Steps to reproduce
%USERPROFILE%\.copilot\instructions\probe.instructions.mdwith front mattername: "Probe"anddescription: "probe", noapplyTo, and a one-line body.~/.copilot/session-state/<session-id>/events.jsonl, take the firstsystem.messageevent, and count occurrences ofname: "Probe"in itscontent.COPILOT_HOME.Observed: the count is 2, and
COPILOT_HOMEisc:\Users\<user>\.copilot.Expected behavior
Instruction directories and files are deduplicated by canonical path — case-insensitively on Windows, after normalizing separators — so each file is loaded once.
Additional context
With four description-only personal instruction files, the duplicate costs about 25K characters of system message in every session. Two workarounds were tried and neither helps: a subdirectory of
~/.copilot/instructionsis duplicated the same way, andCOPILOT_CUSTOM_INSTRUCTIONS_DIRSloads the files as external repository instructions rather than personal ones.