vscode-copilot-release icon indicating copy to clipboard operation
vscode-copilot-release copied to clipboard

Inline chat ignores copilot-instructions.md file

Open nwaywood opened this issue 7 months ago • 6 comments

  • Copilot Chat Extension Version: 1.309.0
  • VS Code Version: 1.99.3
  • OS Version: MacOS 15.3.2

Steps to Reproduce:

  1. Add a .github/copilot-instructions.md file with code generation instructions
  2. Generate code that should use these instructions in both inline chat and sidebar chat, observe that only sidebar chat respects the .github/copilot-instructions.md file

Example: As a simple test I put the following in my .github/copilot-instructions.md file:

# Project coding standards

## Documentation guidelines:
- Use a single line comment style instead of block comment style
- Add "===" at the start and end of each multi line comment 

After highlighting a function, when I type "document this function" in the sidebar chat it follows the instructions. When I type "document this function" in the inline chat, my custom instruction get completely ignored

nwaywood avatar Apr 28 '25 01:04 nwaywood

ok, I see, we need to fix this in the /doc impementation

aeschli avatar Apr 29 '25 11:04 aeschli

@aeschli Yes I did also notice that the /doc command isn't respecting copilot-instructions.md, but freeform text in the inline chat also isn't respecting copilot-instructions.md at the moment

When I type "document this function" as freeform text in the inline chat, my custom instruction from copilot-instructions.md is ignored as well.

nwaywood avatar Apr 30 '25 03:04 nwaywood

For prompts without command it should work. You need to check whether there was a command detection, and you got forwarded to /doc. A screenshot of the dialog would help. Also, there's a setting where you can enable/disable the use of .github/copilot-instructions.md. Check that it is enabled.

aeschli avatar May 02 '25 09:05 aeschli

You need to check whether there was a command detection, and you got forwarded to /doc.

Ah thanks for the explanation, I think you are right.

You can see from the image below that my prompt doesn't contain the /doc command

Image

But then after it runs I can see that /doc got injected by VSCode. If I manually remove this injected /doc command then it's respecting .github/copilot-instructions.md again.

Image

@aeschli I guess this might also need to be fixed for any other commands that can be auto detected by VSCode?

nwaywood avatar May 05 '25 06:05 nwaywood

I have this problem - verified the .github/copilot-instructions.md is in the correct place and that the setting is set:

"github.copilot.chat.codeGeneration.useInstructionFiles": true

Copilot (Claude sonnet in agent mode) consistently ignores this unless I add it as context in each request ... and it's instructions are pretty simple:

## Network/connection
the react app should always run on port 3000 (except in production)
the API application will always run on 8080 (except in production)
in dev our endpoint is export const backendURL = 'http://localhost:8080';
in production it is export const backendURL = 'https://api.pendock.com';

Always assume that both react dev server and sail are running, do not prompt to execute startup commands in the terminal - ask for verification the dev servers are running instead. 
You may prompt for dev server restarts and rebuilds.

Other things in projects like "don't write tests unless specifically directed" get ignored,

It is incredibly frustrating!

BigBlockStudios avatar Aug 03 '25 00:08 BigBlockStudios

Moving this to backlog as part of issue cleanup

sandy081 avatar Oct 03 '25 12:10 sandy081