You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Copilot Agent Host: custom agent frontmatter hooks are dropped #341681
Reported on VS Code 1.143.0-insider, commit 4c6cba15, using the Copilot / Agent Host harness.
Steps to reproduce
In a trusted workspace with hooks enabled, define a custom .agent.md with a SessionStart marker hook and a PreToolUse hook that denies shell execution.
Select that agent in a new Copilot / Agent Host session.
Ask it to run a harmless shell command covered by the deny hook.
Repeat with the selected agent supplied by a file-based plugin.
Expected: The marker hook runs and the deny hook blocks the tool before execution.
Actual: Agent-frontmatter hooks do not run; the tool executes without the agent's denial. Plugin-level and global hooks can still run.
A converter-level probe confirms that hooks are dropped. Direct-runtime execution of equivalent CustomAgentConfig.hooks reportedly runs SessionStart and returns Denied by preToolUse hook; the full packaged-build reproduction remains to be verified.
Preserve agent hooks through conversion while retaining trust, policy, and working-directory semantics. Regression coverage should assert hook execution and tool denial for workspace/user agents and selected plugin agents, plus isolation when switching agents.
The exact @github/[email protected] package pinned by current VS Code declares CustomAgentConfig.hooks. Its toWireCustomAgents serializer preserves the field when provided. The SDK field was added in the October 12 snapshot.
At 9dcad803e, toSdkCustomAgents still does not read or forward frontmatter hooks.
agentHost: keep plugin subagents in Copilot catalog #342092 now projects all enabled plugin agents into the explicit SDK agent catalog. Its rationale confirms that pluginDirectories discovery does not merge those agents back when customAgents is supplied, so the omission needs fixing in the conversion path rather than relying on native plugin discovery.
The docs PR now treats affected plugin-agent scoped-hook migration as incomplete and warns against broadening hooks to plugin-wide/repository-wide events as a workaround. Product regression coverage should retain the source/trust and plugin-path semantics described in this issue, and exercise both selected agents and subagents.
Activity
digitarald commentedon Oct 19, 2026
Additional evidence from the hook migration documentation review in microsoft/vscode-docs#10503:
@github/[email protected]package pinned by current VS Code declaresCustomAgentConfig.hooks. ItstoWireCustomAgentsserializer preserves the field when provided. The SDK field was added in the October 12 snapshot.toSdkCustomAgentsstill does not read or forward frontmatterhooks.pluginDirectoriesdiscovery does not merge those agents back whencustomAgentsis supplied, so the omission needs fixing in the conversion path rather than relying on native plugin discovery.The docs PR now treats affected plugin-agent scoped-hook migration as incomplete and warns against broadening hooks to plugin-wide/repository-wide events as a workaround. Product regression coverage should retain the source/trust and plugin-path semantics described in this issue, and exercise both selected agents and subagents.
aiday-mar commentedon Oct 26, 2026
I see the following, which I assume means the issue is verified.