Skip to content

Add infer and agents fields to Plan agent config and serialization#3252

Merged
digitarald merged 3 commits intomainfrom
digitarald/plan-agent-infer-agents
Jan 29, 2026
Merged

Add infer and agents fields to Plan agent config and serialization#3252
digitarald merged 3 commits intomainfrom
digitarald/plan-agent-infer-agents

Conversation

@digitarald
Copy link
Contributor

Summary

Adds infer and agents fields to the Plan agent configuration, enabling control over subagent discovery and allowed subagents.

Changes

planAgentProvider.ts

  • Add infer?: string and agents?: string[] to PlanAgentConfig interface
  • Set defaults in BASE_PLAN_AGENT_CONFIG: infer: 'user', agents: []
  • Add serialization in buildAgentMarkdown():
    • infer outputs as scalar value
    • agents uses same YAML array format as tools with proper quote escaping

agents.md (skill documentation)

  • Document agents frontmatter field: agents: ["Agent1", "Agent2"] with semantics (omit = all, [] = none)

Behavior

  • agents: [] disables subagent invocation for the Plan agent
  • infer: 'user' enables user-scoped subagent discovery

Copilot AI review requested due to automatic review settings January 28, 2026 23:58
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 28, 2026
@digitarald digitarald enabled auto-merge January 29, 2026 00:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PlanAgentConfig with infer and agents fields and set defaults in BASE_PLAN_AGENT_CONFIG.
  • Emit infer as a scalar and agents as a flow-style YAML array in buildAgentMarkdown().
  • Document the new agents frontmatter 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

  • infer is emitted only when truthy (if (config.infer)), which will drop an explicit false value. If infer is meant to be a boolean frontmatter flag, this prevents generating infer: false to 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/agents is introduced here, but the existing unit tests for buildAgentMarkdown don’t assert these fields (e.g., no case covering infer: false, infer: true, or agents: [] 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
pwang347 previously approved these changes Jan 29, 2026
@digitarald digitarald added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit 0966aa0 Jan 29, 2026
19 checks passed
@digitarald digitarald deleted the digitarald/plan-agent-infer-agents branch January 29, 2026 00:43
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.

3 participants