
customizations-in-the-agent-host
Architecture and hard-won debugging lessons for customization enablement (plugins, MCP servers, agents, skills, instructions) in the agent host. Use when changing how customizations are discovered, published, enabled/disabled, or handed to a provider SDK; when a customization shows the wrong enabled state in the UI; or when a disabled MCP server or plugin is still reaching the model.
- Installs
- 46
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/microsoft/vscode --skill customizations-in-the-agent-host- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads customizations-in-the-agent-host automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Customizations in the Agent Host
Customizations are the plugins, MCP servers, agents, skills and instructions that an agent-host session exposes to a model. This skill covers enablement: how a customization's on/off state is decided, stored, published and enforced.
Read this before changing anything in:
src/vs/platform/agentHost/node/agentHostCustomizationEnablementService.tssrc/vs/platform/agentHost/node/shared/customizationEnablementGate.tssrc/vs/platform/agentHost/common/customizationEnablement.ts- the per-provider customization paths under
node/copilot/,node/claude/,node/codex/
The mental model
Enablement is a list of scoped decisions, not a boolean
A plugin or MCP server carries enablement?: CustomizationEnablement[] — an ordered list of decisions, most specific first:
| Kind | Owner | Meaning |
|---|---|---|
Session | agent host | this session only |
Workspace | agent host | this working directory (carries uri) |
Global | client, unless the host discovered it | everywhere |
isCustomizationEnabled() picks the first entry; absent entries inherit from the next scope out, and an absent list means enabled. Never re-add a parallel enabled boolean to plugins or MCP servers — a second source of truth is what this design exists to remove. (DirectoryCustomization legitimately keeps a plain enabled; consumers derive its state through isCustomizationEnabled() all the same.)
Who owns Global
The host owns Global for anything it discovered, even when that thing lives inside a plugin the client forwarded. The client owns Global only for what it actually bundled. The discriminator is childEnablement — not clientId. A plugin whose childEnablement record has a key for a child MCP server means "the client bundled this child and owns its global decision"; anything else the host discovered by parsing the plugin directory.
The overlay model
This is the single most important invariant, and getting it wrong caused a self-defeating write that silently erased user decisions:
The client's value is the base. Host decisions layer on top. "Store only what differs" compares against that base — never against a hardcoded
true.
Concretely, in agentHostCustomizationEnablementService.ts:
_clientGlobalEnablementis the in-memory base, per session._setClientGlobalwrites here and must never touch_persistent._persistentholds only host-owned decisions that differ from the base.- Inheritance runs host → base →
DEFAULT_CUSTOMIZATION_ENABLED(_globalEnablement,_workspaceInheritedEnablement). _setPersistentDecisiondeletes a decision that matches its inherited value, so the UI can restore inheritance without a third "Inherit" action.
Keeping these separate is what stops this loop: replaceEnablement → synchronous republish → client's stale [{global,true}] → _setClientGlobal → "store only what differs" deletes the entry just written.
Identity must not depend on tree position
An MCP server's storage key is derived from owningPluginUri, never from where it happened to appear in the published tree. The same server discovered top-level (mcpServers#azure) and nested under a plugin (<pluginURI>#mcp=azure) must produce one key, or a decision written in one session is invisible to the next. targetForMcpServer() and withOwningPluginUri() in the gate are the only supported way to build that target.
Pending means fail closed — but pending must be transient
resolve() returns {kind:'pending'} when the session isn't initialized yet (reason: 'session') or the working directory isn't known (reason: 'workingDirectory'). resolveCustomizationEnablement() records those in pendingCustomizationIds, and isCustomizationSdkEligible() makes SDK-boundary consumers fail closed.
Two rules follow:
- Never "fix" a pending customization by defaulting it to enabled.
- Never cache the pending verdict. Pending is a temporary state; recompute it, and republish when the enablement service settles. A cached
pendingEnablement: truesilently drops a plugin forever.
A pending child MCP server also marks its containing plugin pending, because a plugin directory can cause the SDK to discover the child on its own.
The rule that prevents most bugs
Every publication, emit and SDK-handoff path must go through resolution.
Three separate production bugs on this feature came from paths that skipped it (four sites in copilotAgent, one in mcpCustomizationController, plus the post-startup reconcile). When you add a new place that publishes a customization or hands one to a provider, route it through resolveCustomizationEnablement() — do not read a stored snapshot.
The corollary: state computed once must be rebuilt when its inputs change. Merged per-client enablement maps that are only appended to will leak stale decisions onto a newly parsed plugin with the same URI.
Enforcement is per-provider, and they differ
| Provider | Launch | Mid-session |
|---|---|---|
| Copilot | disabledMcpServers on SessionConfig at open/resume | rpc.mcp.enable / rpc.mcp.disable |
| Claude | session options at materialize | live reconcile |
| Codex | MCP servers supplied only at thread/start / resume | not possible — documented limitation |
Enforcement traps:
- The post-startup reconcile runs ~800 ms after launch. Anything gated only there can still start, and request authentication, during the launch window. Gate at launch too.
- The SDK's
not_configuredstatus must not be translated asenabled: true. That bug made a correct "skip this disabled server" decision look like "enable it". - Copilot launch gating must include names from user
mcp.config.list, not only the client snapshot. Reconcile and authentication also resolve newly discovered names before the host retains them; later publication must not turn an inherited enabled default into explicit intent to enable an SDK-configured-disabled server. - Root MCP customization IDs use the owning AHP session ID, not its SDK backing ID. On restoration, derive declared MCP names from the applied root/plugin definitions, never from the retained host-published runtime inventory.
- Connection lifecycle (
pending,connected,stopped) is not enablement intent. Confirm external toggles against passivemcp.listConfiguredenablement, ignoring stale asynchronous snapshots and host-requested changes.
Client-provided MCP servers (ones the client bundled rather than the host discovering) must route their global Disable to the client, not the host — the host correctly refuses to store a client-owned global, so routing it to the host is a silent no-op. isClientBundled is the discriminator; see getBuiltinMcpServerEnablementActions in mcpListWidget.ts.
Debugging playbook
Rank your signals. They disagree, and the model lies:
- Primary — the published customization object and the host's stored decision.
- Definitive for tool exposure —
tool_search override … clientMatched=[…]inAgent Host.log. - Secondary — the customizations UI.
- Corroborating only — what the model says. A model answered "yes, I have azure tools" while the server was
stopped. Never conclude from this alone.
Reproduction recipe that exercises the real failure surface: start a session, send a message to boot everything, disable the thing, then ask a new session whether it has those tools. Cross-session persistence is where identity and overlay bugs surface.
Use the agent-host-logs skill for exported bundles, and the launch skill to drive a real instance.
Known false alarms:
- The
azureplugin contributes 24azure-*skills in addition to its MCP server. Disabling the server correctly leaves the skills enabled. sleepyis a deliberately broken test server that cannot initialize — useless as a positive control.
Gotchas that cost real time
CustomizationTypeandCustomizationEnablementKindareconst enums. A type-only import compiles and lints cleanly, then crashes at runtime. Import them as values.- The unit-test runner uses pre-compiled output and does not fail on type errors. Always run
npm run typecheck-clientseparately. - Integration-test servers start with
--quiet. Wiring that you hoist out ofif (!options.quiet)inagentHostServerMain.tssilently changes their behaviour — hoistingsetWorktreeIsolationmade quiet servers resolveisolation: 'folder'and broke seven unrelated tests. - Protocol files under
common/state/protocol/carry a "DO NOT EDIT — auto-generated" banner. Changes there need a matching backport to theagent-host-protocolrepo. - Electron runner setup aborts (
EEXIST/EPERM/ENOENT/ReactiveObjC) are environmental. Recover withrm -rf .build/electron && npm run electron.
Validation
npm run typecheck-client
./scripts/test.sh --grep "customizationEnablement"
./scripts/test-integration.sh --runGlob "**/agentHost/**/{sessionConfig,toolApproval,codexCustomizations}.integrationTest.js"
./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/claudeAgent.integrationTest.ts
Tests that construct an agent session directly need IAgentHostCustomizationEnablementService in their service collection; use createNoopCustomizationEnablementService() from src/vs/platform/agentHost/test/node/testCustomizationEnablementService.ts.
FAQ
What does the customizations-in-the-agent-host skill do?
Architecture and hard-won debugging lessons for customization enablement (plugins, MCP servers, agents, skills, instructions) in the agent host. Use when changing how customizations are discovered, published, enabled/disabled, or handed to a provider SDK; when a customization shows the wrong enabled state in the UI; or when a disabled MCP server or plugin is still reaching the model.
How do I install customizations-in-the-agent-host?
Run npx skills add https://github.com/microsoft/vscode --skill customizations-in-the-agent-host in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/customizations-in-the-agent-host/ (personal) or .claude/skills/customizations-in-the-agent-host/ (project).
Which AI agents can use customizations-in-the-agent-host?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is customizations-in-the-agent-host safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains customizations-in-the-agent-host?
It is published by microsoft in microsoft/vscode. It has 46 recorded installs.
More from microsoft/vscode
memory-leak-audit
microsoft/vscode
Audit code for memory leaks and disposable issues. Use when reviewing event listeners, DOM handlers, lifecycle callbacks, or fixing leak reports. Covers addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose patterns.
azure-pipelines
microsoft/vscode
Use when validating Azure DevOps pipeline changes for the VS Code build. Covers queueing builds, checking build status, viewing logs, and iterating on pipeline YAML changes without waiting for full CI runs.
accessibility
microsoft/vscode
Primary accessibility skill for VS Code. REQUIRED for new feature and contribution work, and also applies to updates of existing UI. Covers accessibility help dialogs, accessible views, verbosity settings, signals, ARIA announcements, keyboard navigation, and ARIA labels/roles.
sessions
microsoft/vscode
Core principles and workflow router for changes to the Agents Window under src/vs/sessions.
author-contributions
microsoft/vscode
Identify all files a specific author contributed to on a branch vs its upstream, tracing code through renames. Use when asked who edited what, what code an author contributed, or to audit authorship before a merge. This skill should be run as a subagent — it performs many git operations and returns a concise table.
update-screenshots
microsoft/vscode
Update the committed blocks-ci screenshot hashes after the "Screenshots & Tests" check fails, or investigate a screenshot diff reported on a PR. Use when asked to update, accept, or refresh component screenshot baselines from CI. This skill should be run as a subagent.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available