Add infer and agents fields to Plan agent config and serialization#3252
Merged
digitarald merged 3 commits intomainfrom Jan 29, 2026
Merged
Add infer and agents fields to Plan agent config and serialization#3252digitarald merged 3 commits intomainfrom
digitarald merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for infer and agents frontmatter fields to the Plan agent configuration/serialization, and updates the custom agents documentation to describe the agents field.
Changes:
- Extend
PlanAgentConfigwithinferandagentsfields and set defaults inBASE_PLAN_AGENT_CONFIG. - Emit
inferas a scalar andagentsas a flow-style YAML array inbuildAgentMarkdown(). - Document the new
agentsfrontmatter field in the custom agents primitives doc.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/extension/agents/vscode-node/planAgentProvider.ts | Adds infer/agents to Plan agent config defaults and serializes them into generated .agent.md frontmatter. |
| assets/prompts/skills/agent-customization/primitives/agents.md | Documents agents frontmatter semantics and example usage. |
Comments suppressed due to low confidence (2)
src/extension/agents/vscode-node/planAgentProvider.ts:102
inferis emitted only when truthy (if (config.infer)), which will drop an explicitfalsevalue. Ifinferis meant to be a boolean frontmatter flag, this prevents generatinginfer: falseto override the default behavior.
Suggestion: treat infer as boolean | undefined and emit it when it is explicitly set (e.g., check for !== undefined).
if (config.infer) {
lines.push(`infer: ${config.infer}`);
}
src/extension/agents/vscode-node/planAgentProvider.ts:115
- New serialization behavior for
infer/agentsis introduced here, but the existing unit tests forbuildAgentMarkdowndon’t assert these fields (e.g., no case coveringinfer: false,infer: true, oragents: []vs omitted). Adding targeted tests would help prevent regressions in YAML output formatting and semantics.
if (config.infer) {
lines.push(`infer: ${config.infer}`);
}
// Tools array - flow style for readability
// Escape single quotes by doubling them (YAML spec)
if (config.tools.length > 0) {
const quotedTools = config.tools.map(t => `'${t.replace(/'/g, '\'\'')}'`).join(', ');
lines.push(`tools: [${quotedTools}]`);
}
// Agents array - same format as tools (empty array = no subagents allowed)
if (config.agents) {
const quotedAgents = config.agents.map(a => `'${a.replace(/'/g, '\'\'')}'`).join(', ');
lines.push(`agents: [${quotedAgents}]`);
}
pwang347
previously approved these changes
Jan 29, 2026
dmitrivMS
approved these changes
Jan 29, 2026
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.
Summary
Adds
inferandagentsfields to the Plan agent configuration, enabling control over subagent discovery and allowed subagents.Changes
planAgentProvider.tsinfer?: stringandagents?: string[]toPlanAgentConfiginterfaceBASE_PLAN_AGENT_CONFIG:infer: 'user',agents: []buildAgentMarkdown():inferoutputs as scalar valueagentsuses same YAML array format astoolswith proper quote escapingagents.md(skill documentation)agentsfrontmatter field:agents: ["Agent1", "Agent2"]with semantics (omit = all, [] = none)Behavior
agents: []disables subagent invocation for the Plan agentinfer: 'user'enables user-scoped subagent discovery