Describe the bug
The rg tool crashes with TypeError: Cannot read properties of undefined (reading 'isExcluded') from the Copilot CLI's ContentExclusionFilter class in index.js.
// ContentExclusionFilter.isExcluded(e, r):
async processBatch(e) {
let r = this.contentExclusionService; // ← this is undefined
...
return this.isExcluded(s, r) // ← r passed here
}
isExcluded(e, r) {
n = r.isExcluded(e).then(...) // ← r.isExcluded crashes: r is undefined
}
Root cause: When the Copilot CLI runs in embedded/headless mode, the contentExclusionService is not initialized on the ContentExclusionFilter instance. The SDK assumes a fully authenticated session context where ContentExclusionService is always provided. In headless mode it's undefined, causing a hard crash on every rg call that exercises the batch content-exclusion check.
The filter should null-check contentExclusionService before calling .isExcluded(). The existing SDK code has a .catch() handler in isExcluded() for the promise path, but the crash happens before the promise is even created because r itself is undefined.
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response
Describe the bug
The rg tool crashes with TypeError: Cannot read properties of undefined (reading 'isExcluded') from the Copilot CLI's ContentExclusionFilter class in index.js.
Root cause: When the Copilot CLI runs in embedded/headless mode, the contentExclusionService is not initialized on the ContentExclusionFilter instance. The SDK assumes a fully authenticated session context where ContentExclusionService is always provided. In headless mode it's undefined, causing a hard crash on every rg call that exercises the batch content-exclusion check.
The filter should null-check contentExclusionService before calling .isExcluded(). The existing SDK code has a .catch() handler in isExcluded() for the promise path, but the crash happens before the promise is even created because r itself is undefined.
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response