Skip to content

agentHost: Respect disabled AI features - #326902

Merged
roblourens merged 10 commits into
mainfrom
roblou/agents/ai-features-disable-flag-review
Jul 25, 2026
Merged

agentHost: Respect disabled AI features#326902
roblourens merged 10 commits into
mainfrom
roblou/agents/ai-features-disable-flag-review

Conversation

@roblourens

@roblourens roblourens commented Jul 22, 2026

Copy link
Copy Markdown
Member

Fixes #326634

Summary

  • include chat.disableAIFeatures in the central Agent Host startup enablement decision
  • preserve the existing eager, fixed-at-startup enablement lifecycle
  • prevent Agent Host process startup and hide dependent Agent Host features after a fresh restart when AI features are disabled
  • add regression coverage for the enablement result and context key

Validation

  • npm run precommit
  • Electron unit tests: AgentHostEnablementService
  • browser unit tests: AgentHostEnablementService
  • direct A/B isolated fresh launches with workspace-scoped .vscode/settings.json while the service remained Eager:
    • chat.disableAIFeatures: true → Agent Host process not spawned
    • chat.disableAIFeatures: false → Agent Host process spawned

(Written by Copilot)

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 22, 2026 00:28

Copilot AI left a comment

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.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR updates Agent Host enablement so that disabling AI features (chat.disableAIFeatures) also disables Agent Host startup and related UI gating, and adds regression coverage for the service + context key.

Changes:

  • Extend Agent Host enablement decision to account for chat.disableAIFeatures.
  • Update enablement/context-key wording to reflect “features enabled” rather than “process enabled”.
  • Add a browser test covering enablement + context key behavior across key config combinations.
Show a summary per file
File Description
src/vs/platform/agentHost/browser/agentHostEnablementService.ts Adds chat.disableAIFeatures to the enablement boolean used to gate Agent Host behavior and context key.
src/vs/platform/agentHost/common/agentHostEnablementService.ts Updates public-facing docs/strings to reflect new “features enabled” semantics.
src/vs/platform/agentHost/test/browser/agentHostEnablementService.test.ts Adds regression tests verifying enablement + context key values for relevant config scenarios.

Review details

  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread src/vs/platform/agentHost/common/agentHostEnablementService.ts Outdated
Comment thread src/vs/platform/agentHost/browser/agentHostEnablementService.ts
roblourens and others added 4 commits July 21, 2026 20:58
(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Track live per-window Agent Host enablement, tear down dependent registrations, and stop the shared process after the last enabled client disconnects.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens
roblourens requested a review from Copilot July 24, 2026 03:41
Remove live process teardown and defer Agent Host enablement until window-scoped workspace configuration has been restored.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

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.

Review details

  • Files reviewed: 23/23 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread src/vs/platform/agentHost/electron-main/electronAgentHostStarter.ts Outdated
Comment thread src/vs/platform/agentHost/browser/agentHostEnablementService.ts Outdated
roblourens and others added 2 commits July 23, 2026 20:58
(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens
roblourens marked this pull request as ready for review July 25, 2026 01:37
@roblourens
roblourens enabled auto-merge (squash) July 25, 2026 01:37
@roblourens
roblourens requested a review from Copilot July 25, 2026 01:38
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@deepak1556

Matched files:

  • src/vs/code/electron-main/app.ts

A direct workspace-scoped startup test confirms that checking chat.disableAIFeatures is sufficient without changing service instantiation timing.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jruales
jruales previously approved these changes Jul 25, 2026

Copilot AI left a comment

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.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment thread src/vs/platform/agentHost/browser/agentHostEnablementService.ts
Comment thread src/vs/platform/agentHost/common/agentHostEnablementService.ts Outdated
Comment thread src/vs/platform/agentHost/common/agentHostEnablementService.ts Outdated
@roblourens
roblourens marked this pull request as draft July 25, 2026 01:55
auto-merge was automatically disabled July 25, 2026 01:55

Pull request was converted to draft

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens
roblourens marked this pull request as ready for review July 25, 2026 02:00
@roblourens
roblourens enabled auto-merge (squash) July 25, 2026 02:00
@roblourens
roblourens merged commit f236d93 into main Jul 25, 2026
29 checks passed
@roblourens
roblourens deleted the roblou/agents/ai-features-disable-flag-review branch July 25, 2026 02:14
@vs-code-engineering vs-code-engineering Bot added this to the 1.131.0 milestone Jul 25, 2026
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.

Agent host is launching and it's launching copilot CLI when I have explicitly opted out of AI features

3 participants