Repository navigation
Description
AI disclosure: This issue was drafted with AI assistance. A human reproduced the behavior and technically investigated it. This is a real problem observed in our company environment.
Anonymization: Repository names, paths, and remotes below are placeholders. The workspace structure and repository relationship reflect the reproduced setup.
Summary
A Copilot content exclusion configured for a nested repository appears to affect unrelated files in the outer repository when both repositories are present in the same VS Code workspace.
Environment
- Copilot Chat Extension Version: 0.41
- VS Code Version: 1.139.1
- OS Version: Ubuntu 24.04.1
- Feature (e.g. agent/edit/ask mode): agent
- Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): model independ
- Logs: see below
The content exclusion is configured only for the nested repository:
[email protected]:vendors/controller-kit.git:
- "**/*"
Workspace structure
device-suite/ [outer Git repository]
├── apps/
│ └── data-service/src/DatabaseControlService.hpp
├── services/
│ └── edge-gateway/src/api/firmware/mod.rs
└── vendors/
└── controller-kit/ [separate nested Git repository]
Steps to reproduce
- Open device-suite as a VS Code workspace.
- Keep the nested vendors/controller-kit repository in the workspace.
- Configure the
**/*content exclusion for the nested repository only. - Ask Copilot to access a file elsewhere in the outer repository, such as one under apps/ or services/.
Actual behavior
Copilot reports files outside the nested repository as excluded:
[debug] File /workspaces/device-suite/apps/data-service/src/DatabaseControlService.hpp is ignored by content exclusion rule **/*
[debug] File /workspaces/device-suite/services/edge-gateway/src/api/firmware/mod.rs is ignored by content exclusion rule **/*
The behavior persists after reloading the VS Code window.
Expected behavior
The **/* rule should apply only to files within vendors/controller-kit. Files in the outer repository should remain available to Copilot unless they have their own applicable exclusion.
Technical investigation
Inspection of the installed extension bundle suggests that exclusion patterns from loaded repositories may be compiled into a shared matcher without preserving which repository supplied each pattern. This would allow the nested repository’s **/* rule to match files elsewhere in the workspace.
There is no .copilotignore file in the workspace, and Git does not report the affected files as ignored.
Suggested fix
Preserve the repository associated with each content exclusion and evaluate its path patterns only against files within that repository.
Activity
sw23 commentedon Oct 2, 2026
My team is hitting this on VS Code 1.138.0 (Linux x64) and GitHub Copilot Chat 0.66.0.
We have several multi-root workspaces containing a parent repository and a folder with several nested
repositories. One nested repository receives
paths: ["*"]from an enterprise content-exclusionpolicy. After those rules are fetched, Copilot rejects files in the parent repository and unrelated
nested repositories. I had one of the AI models review the code:
Inspecting the 0.66.0 extension bundle points to the same root cause described here.
applyRules()stores rules per repository in
_contentExclusionCache, butrebuildCompiledRules()flattens everyrepository's path globs into one
_compiledGlobslist.isIgnored(uri)then tests the file againstevery glob in that list. The content-based
ifAnyMatchandifNoneMatchrules remain scoped to thefile's repository; only the path globs leak across repositories.
Removing the folder that contains the excluded nested repository from the workspace and reloading
restores access.
files.excludeandsearch.excludedo not work around the problem because nestedrepository discovery searches for
**/.git/HEADwithExcludeSettingOptions.None.