Claude agent — Phase 11: customizations / plugins#318113
Draft
TylerLeonhardt wants to merge 3 commits into
Draft
Claude agent — Phase 11: customizations / plugins#318113TylerLeonhardt wants to merge 3 commits into
TylerLeonhardt wants to merge 3 commits into
Conversation
Workbench-pushed customizations (setClientCustomizations /
setCustomizationEnabled) flow through IAgentPluginManager into
Options.plugins for the Claude SDK Query. Server-side
(SDK-discovered) commands / agents / MCP servers are projected as a
single "Discovered in Claude" Open Plugins-conformant on-disk bundle.
Notable design notes:
- The SDK's Query.reloadPlugins() is parameterless and cannot
change the plugin URI set after startup, so any client-side
customization change triggers a yield-restart through the same
rematerializer path used for client-tool changes. send()'s
pre-flight runs a single rebind when either toolDiff or
clientCustomizationsDiff is dirty.
- SessionClientCustomizationsDiff drives dirty from the model
state observable (not just enabledPluginPaths), so nonce bumps
and metadata refreshes at the same URI are detected.
- setClientCustomizations runs inside the per-session sequencer so
a fire-and-forget call from AgentSideEffects cannot race a first
sendMessage.
- ClaudeSdkCustomizationBundler writes a hashed, content-addressed
on-disk tree under the plugin manager's basePath. Repeated
calls with the same SDK snapshot are nonce-stable and skip the
rewrite. The on-disk tree is intentionally a cross-session warm
cache.
Tests:
- New customizations/ test folder mirrors the source structure:
SessionClientCustomizationsDiff (URI list, nonce, metadata,
enablement, dirty semantics), projector (client+server merge),
bundler (write layout, nonce stability, name sanitisation,
namespacing, delete-on-change).
- claudeAgent.test.ts: sync-and-toggle dispatch, sequencer
serialisation, rebind on customizations dirty, mid-turn race
coverage, swallowed-SDK-snapshot fallback in
getSessionCustomizations.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements Phase 11 of the Claude agent provider in the agent host by wiring client-pushed customizations/plugins into session state and projecting SDK-discovered customizations as an on-disk Open Plugins bundle so the workbench can surface both tiers consistently.
Changes:
- Add per-session client customization state (
syncedsnapshot + enablement overlay + dirty/consume semantics) and project enabled plugin dirs intoOptions.pluginsat SDK startup/restart. - Add SDK-side customizations snapshotting and bundle them into a synthetic “Discovered in Claude” Open Plugins layout under
IAgentPluginManager.basePath. - Wire the new flows through
ClaudeAgent/ClaudeAgentSessionand add unit/integration tests plus supporting docs/plan updates.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/customizations/claudeSessionCustomizationsProjector.test.ts | Unit tests for merging client-pushed customizations with the discovered bundle. |
| src/vs/platform/agentHost/test/node/customizations/claudeSessionClientCustomizationsModel.test.ts | Unit tests for client customization diff/model behavior (dirty/consume/enablement). |
| src/vs/platform/agentHost/test/node/customizations/claudeSdkCustomizationBundler.test.ts | Unit tests for bundling SDK-discovered customizations into an Open Plugins tree. |
| src/vs/platform/agentHost/test/node/claudeSdkPipeline.test.ts | Tests for new pipeline reloadPlugins forwarding. |
| src/vs/platform/agentHost/test/node/claudeSdkOptions.test.ts | Tests for projecting plugin directories into SDK Options.plugins. |
| src/vs/platform/agentHost/test/node/claudeAgent.test.ts | Phase 11 coverage: sync dispatch, fan-out toggles, rebind behavior, race coverage, snapshot failure fallback. |
| src/vs/platform/agentHost/test/node/claudeAgent.integrationTest.ts | Stubs IAgentPluginManager for proxy-backed integration coverage. |
| src/vs/platform/agentHost/node/claude/roadmap.md | Roadmap update (adds Phase 16 entry and sequencing note). |
| src/vs/platform/agentHost/node/claude/phase11-plan.md | New Phase 11 plan/design document captured alongside implementation. |
| src/vs/platform/agentHost/node/claude/customizations/claudeSessionCustomizationsProjector.ts | Projects client-pushed customizations + discovered bundle into protocol SessionCustomization[]. |
| src/vs/platform/agentHost/node/claude/customizations/claudeSessionClientCustomizationsModel.ts | New per-session observable model + diff tracking for client-pushed customizations/plugins. |
| src/vs/platform/agentHost/node/claude/customizations/claudeSdkCustomizationBundler.ts | New bundler that materializes SDK discovery into a synthetic on-disk Open Plugins bundle. |
| src/vs/platform/agentHost/node/claude/claudeSdkPipeline.ts | Adds plugin reload + resolved-customizations snapshot APIs used by session customization projection. |
| src/vs/platform/agentHost/node/claude/claudeSdkOptions.ts | Adds plugins?: URI[] input and maps it to SDK Options.plugins. |
| src/vs/platform/agentHost/node/claude/claudeAgentSession.ts | Owns per-session client customization state, passes plugins at materialize/rebind, and exposes merged session customizations. |
| src/vs/platform/agentHost/node/claude/claudeAgent.ts | Implements customization-related IAgent surface: syncing, toggling, aggregation event, and session projection. |
Copilot's findings
- Files reviewed: 16/16 changed files
- Comments generated: 2
| return { | ||
| customization: { | ||
| customization: { | ||
| uri: URI.parse(uri), |
Comment on lines
+89
to
+93
| if (cur.enablement.get(uri) === enabled) { | ||
| return; | ||
| } | ||
| const next = new Map(cur.enablement); | ||
| next.set(uri, enabled); |
Member
Author
|
@copilot fix the lint errors and comments |
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Contributor
Addressed in aa39ee9. I fixed the CI type/lint failures and review feedback by correcting the customization URI test shape, adding the missing SlashCommand |
Member
Author
|
@copilot fix the test failure |
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 11 of the Claude agent provider in the agent host.
Behaviour
setClientCustomizations/setCustomizationEnabledflow throughIAgentPluginManagerintoOptions.pluginson the Claude SDKQuery.Queryare projected as a single "Discovered in Claude" Open Plugins-conformant on-disk bundle so the workbench's plugin expander surfaces them next to client-pushed entries.Design notes
Tests
New `customizations/` test folder mirrors the source structure:
`claudeAgent.test.ts`:
Draft for review. No telemetry impact, no proposed-API changes.