Skip to content

feat: Respect chat.disableAIFeatures for "Context for AI" in test failures#793

Open
Skn0tt with Copilot wants to merge 2 commits into
mainfrom
copilot/disable-ai-features
Open

feat: Respect chat.disableAIFeatures for "Context for AI" in test failures#793
Skn0tt with Copilot wants to merge 2 commits into
mainfrom
copilot/disable-ai-features

Conversation

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Users in environments where AI tooling is disabled via VS Code's chat.disableAIFeatures setting still saw the "Context for AI" dropdown attached to failing test messages. This change makes the extension honor that setting.

Changes

  • src/extension.ts: _extractAIContext() returns early when chat.disableAIFeatures is enabled, so no page snapshot context is attached and the "Context for AI" block is omitted from failure messages.
  • tests/run-tests.spec.ts: Added coverage asserting the "Context for AI" block and page snapshot are absent when the setting is on.
private _extractAIContext(result: reporterTypes.TestResult): string | undefined {
  // Respect the global VS Code setting that disables all AI-related features.
  if (this._vscode.workspace.getConfiguration('chat').get('disableAIFeatures'))
    return;
  // ...
}

Copilot AI changed the title [WIP] Skip 'Context for AI' when chat.disableAIFeatures is enabled Respect chat.disableAIFeatures for "Context for AI" in test failures Jul 3, 2026
Copilot AI requested a review from Skn0tt July 3, 2026 07:48
Copilot finished work on behalf of Skn0tt July 3, 2026 07:48
@Skn0tt Skn0tt marked this pull request as ready for review July 3, 2026 07:50
@Skn0tt Skn0tt requested a review from dgozman July 3, 2026 07:50
@Skn0tt Skn0tt changed the title Respect chat.disableAIFeatures for "Context for AI" in test failures feat: Respect chat.disableAIFeatures for "Context for AI" in test failures Jul 3, 2026
Comment thread src/extension.ts

private _extractAIContext(result: reporterTypes.TestResult): string | undefined {
// Respect the global VS Code setting that disables all AI-related features.
if (this._vscode.workspace.getConfiguration('chat').get('disableAIFeatures'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a more official way to get this? Or is this the way? If it is documented somewhere, let's link to that place.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding a zip to the repo?

Comment thread tests/run-tests.spec.ts
expect(log).toContain(`- button "click me"`);
});

test('should not provide page snapshot to copilot when chat.disableAIFeatures is enabled', async ({ activate }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the most meaningful test I've seen 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: vscode extension - AI features should be disabled when chat.disableAIFeatures is enabled

3 participants