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

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 <[email protected]>
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

roblourens and others added 4 commits July 21, 2026 20:58
(Written by Copilot)

Co-authored-by: Copilot <[email protected]>
(Written by Copilot)

Co-authored-by: Copilot <[email protected]>
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 <[email protected]>
@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 <[email protected]>

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

@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:

Robo (@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 <[email protected]>

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

@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 <[email protected]>
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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