Repository navigation
"chat.disableAIFeatures" does not disable Copilot Context Provider registration #14294
Description
Activity
sean-mcmanus commented on Mar 17, 2026
Néstor Sancho (@theNestruo) Isn't that just logged when debugging? Those are not error messages, but normal debug logging. We don't own those other settings so it's not clear to me that we should be checking those versus detecting the failure. The registration fails regardless.
sean-mcmanus commented on Mar 18, 2026
Néstor Sancho (@theNestruo) It looks like this is the only spot our extension uses console.debug so we can just remove it: #14296
Uh...well, that PR avoids the error, but we still attempt the registration and fail...but as mentioned earlier, that seems like "by design" to me (the owner of the setting is checking it and returning the result to us as a failure to register).
@theNestruo Isn't that just logged when debugging? Those are not error messages, but normal debug logging.
Yes, you are right. I was unable to reproduce it other way, but did not associate it to be a debug-only message. Sorry!
Uh...well, that PR avoids the error, but we still attempt the registration and fail...but as mentioned earlier, that seems like "by design" to me (the owner of the setting is checking it and returning the result to us as a failure to register).
It's OK, I guess... I was expecting VS Code to provide some flag to the extensions to notify the extension that the user has opted out of AI features, but it seems I was wrong. And while explicitly checking vscode.workspace.getConfiguration("chat").get("disableAIFeatures") is possible, it is definitely hacky.
Thank you very much for taking a look and fixing it! :)
sean-mcmanus commented on Mar 24, 2026
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
Copilot Completion Context Provider registration is attempted even if the user has disabled AI feature ("chat.disableAIFeatures").
Steps to Reproduce:
Have C/C++ extension installed in VS Code.
Configure your VS Code installation to disable any AI feature (set "chat.disableAIFeatures" to true, uninstall any Copilot extension, and disallow them). Relevant settings.json entries:
{ "chat.disableAIFeatures": true, "extensions.allowed": { "GitHub.copilot": false, "GitHub.copilot-chat": false, "*": true },Open the source code of an extension
Run the extension in debug mode (F5, "Debug: Start Debugging")
Without any ohter interaction, the following Copilot-related messages (blue color) appear in the Debug Console:
Those messages can be found at https://github.com/microsoft/vscode-cpptools/blob/main/Extension/src/LanguageServer/copilotCompletionContextProvider.ts#L469 and https://github.com/microsoft/vscode-cpptools/blob/main/Extension/src/LanguageServer/copilotCompletionContextProvider.ts#L469
Expected behavior:
Extension should respect "chat.disableAIFeatures" user setting and cleanly avoid attempting Copilot Completion Context Provider registration instead of attempting it, and logging two errors.
Configuration and Logs
{ "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "intelliSenseMode": "${default}" } ], "version": 4 }Other Extensions
No response
Additional context
No response