Skip to content

Share scoped customizations with Agent Host automations - #333698

Draft
Paul (pwang347) wants to merge 6 commits into
microsoft:mainfrom
pwang347:pawang/automation-mcp
Draft

Share scoped customizations with Agent Host automations#333698
Paul (pwang347) wants to merge 6 commits into
microsoft:mainfrom
pwang347:pawang/automation-mcp

Conversation

@pwang347

@pwang347 Paul (pwang347) commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

  • capture the normal Agent Host customization view per session provider and working-directory scope
  • expose those snapshots through one reserved, host-owned Automation virtual client
  • share content-addressed plugin artifacts across every Automation targeting the same scope
  • refresh snapshots while an eligible VS Code client is connected and propagate plugin additions, changes, and removals
  • retain the exact snapshot used by each running Automation so scope updates cannot evict an in-flight revision

Design

Regular Agent Host chats resolve customizations in the workbench because plugin discovery, MCP configuration, enablement, and client-backed files live there. Scheduled Automations must also run when no UI client is connected.

A connected provider client therefore publishes a full snapshot resolved through the existing IAgentHostActiveClientService scope. Agent Host materializes all referenced plugin artifacts before atomically committing the snapshot under (session provider, working directories). Automation definitions store only a small capture acknowledgement; Automations sharing a scope reuse the same snapshot and plugin directories.

At run time, Agent Host creates the session with the reserved vscode-automations virtual client. It contributes the latest committed customization snapshot and no client-executed tools. Each non-terminal run independently pins the revision it started with, while the shared scope can continue advancing. External AHP clients cannot connect or publish actions using the reserved identity.

Malformed cache entries are ignored without disabling the Automation catalog, and prior per-Automation snapshots are migrated into the shared scope store. A failed scope resolution never replaces the last successful snapshot; a failed plugin refresh retains that plugin's previous materialized revision when available.

Validation

  • npm run typecheck-client
  • affected Agent Host, Automation store, local/remote provider, and active-client suites: 909 passing, 11 pending
  • AgentService suite: 395 passing, 16 pending
  • pre-commit hygiene checks
  • final specialist code review: no high-confidence findings

Forward local plugin customizations to Agent Host automation sessions so scheduled and headless runs can use their MCP servers.

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

Copilot-Session: 49b955ef-d7c2-471d-b207-e6c03e99ad19
Copilot AI balanced review requested due to automatic review settings September 1, 2026 01:00

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.

Copilot review overview

Review tier: Balanced
Findings: 3 Medium severity

New issues introduced by this change (3)
Severity Finding
Medium severity src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostAutomationPluginsContribution.ts — This converts the current workspace-effective state into a Global decision. A workspace override…
Medium severity src/​vs/​platform/​agentHost/​node/​agentConfigurationService.ts — This queues a duplicate disk write for each matching client update. Client RootConfigChanged
Medium severity src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostAutomationPluginsContribution.ts — The new workbench producer is untested; the AgentService test injects automationClientPlugins
What changed in this PR

Enables local file-backed plugins in host-created Automation sessions.

Changes:

  • Forwards and persists local plugin snapshots.
  • Seeds Automation sessions with a reserved synthetic active client.
  • Materializes host-local plugins and rejects synthetic identity spoofing.
File Description
agentHostAutomationPluginsContribution.ts Publishes local plugin snapshots.
agentHost.contribution.ts Registers the contribution.
agentHostCustomizationConfig.ts Defines snapshot schema and conversion.
agentConfigurationService.ts Persists forwarded snapshots.
agentService.ts Seeds Automation sessions.
agentPluginManager.ts Reads synthetic-client plugins locally.
protocolServerHandler.ts Protects the reserved identity.
agentConfigurationService.test.ts Tests snapshot persistence.
agentPluginManager.test.ts Tests host-local materialization.
agentService.test.ts Tests Automation session seeding.
protocolServerHandler.test.ts Tests spoofing rejection.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/platform/agentHost/node/agentConfigurationService.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 49b955ef-d7c2-471d-b207-e6c03e99ad19
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 49b955ef-d7c2-471d-b207-e6c03e99ad19
Persist each Automation's scoped active-client customizations, materialize them through the originating client, and retain their cached plugin revisions for headless runs.

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

Copilot-Session: 49b955ef-d7c2-471d-b207-e6c03e99ad19
Use one host-owned virtual client with scope-keyed snapshots, shared materialized artifacts, continuous client refresh, and per-run retention.

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

Copilot-Session: 49b955ef-d7c2-471d-b207-e6c03e99ad19
@pwang347 Paul (pwang347) changed the title Enable local MCP plugins in automations Share scoped customizations with Agent Host automations Sep 1, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 49b955ef-d7c2-471d-b207-e6c03e99ad19
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.

2 participants