Context exclusion not working just after VS code starts #188772
Replies: 2 comments 1 reply
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Your hypothesis is likely correct. When VS Code starts, extensions are activated asynchronously. GitHub Copilot can begin generating suggestions as soon as the extension initializes, while repository settings such as During that short initialization window, Copilot may temporarily generate suggestions before the exclusion rules are enforced. Once the extension finishes syncing repository configuration and policy settings, the exclusions start working as expected. A few things you can try to reduce or eliminate this behavior:
If strict privacy is required, the safest approach is to disable Copilot entirely for repositories containing sensitive files or ensure those files are excluded at the repository or organization level. You may also want to report this behavior directly to the Copilot extension repository so the team can consider delaying suggestions until all exclusion rules are loaded. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Copilot Feature Area
VS Code
Body
Hi,
There is a problem with context exclusion. I set up files which should be excluded, and generally it works. But then I noticed that just after opening VS Code I still see code suggestions in those files. There is a few-second window where it works, then it works as intended (no suggestions for excluded files, suggestions generated for the rest). It's a problem because the excluded files (I tried both the organization context exclusion and .copilotignore in the repo) should never go into the model context, because of the privacy concerns. If they still go into the context even once after the editor starts, the whole concept is not working basically.
My hypothesis is that it takes some time for the copilot plugin to initialize, and it is able to generate suggestions before it gets the information about context exclusion. I suppose that the copilot plugin should not generate any suggestions before the full initialization (or just to set up a delay like 10 or 20 seconds) where the plugin is not doing anything whatsoever to make sure everything is properly initialized.
VS Code:
Version: 1.110.0
Commit: 0870c2a0c7c0564e7631bfed2675573a94ba4455
Date: 2026-03-04T01:20:28.863Z
Electron: 39.6.0
ElectronBuildId: 13330601
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Linux x64 5.15.0-168-generic snap
Copilot plugin:
Identifier github.copilot-chat
Version 0.38.0
Last Updated 23 hours ago
Beta Was this translation helpful? Give feedback.
All reactions