feat(core): optimize sub-agents system prompt intro (#18608)

This commit is contained in:
N. Taylor Mullen
2026-02-10 00:25:42 -08:00
committed by GitHub
parent 67d9b76e81
commit 2ae5e1ae20
5 changed files with 14 additions and 54 deletions

View File

@@ -531,11 +531,7 @@ exports[`Core System Prompt (prompts.ts) > should append userMemory with separat
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
<subagent>
@@ -1312,11 +1308,7 @@ exports[`Core System Prompt (prompts.ts) > should include correct sandbox instru
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
<subagent>
@@ -1429,11 +1421,7 @@ exports[`Core System Prompt (prompts.ts) > should include correct sandbox instru
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
<subagent>
@@ -1546,11 +1534,7 @@ exports[`Core System Prompt (prompts.ts) > should include correct sandbox instru
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
<subagent>
@@ -1771,15 +1755,11 @@ exports[`Core System Prompt (prompts.ts) > should include sub-agents in XML for
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
<subagent>
<name>Test Agent</name>
<name>test-agent</name>
<description>A test agent description</description>
</subagent>
</available_subagents>
@@ -2123,11 +2103,7 @@ exports[`Core System Prompt (prompts.ts) > should return the base prompt when us
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
<subagent>
@@ -2236,11 +2212,7 @@ exports[`Core System Prompt (prompts.ts) > should return the base prompt when us
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
<subagent>
@@ -2460,11 +2432,7 @@ exports[`Core System Prompt (prompts.ts) > should use chatty system prompt for p
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
<subagent>
@@ -2573,11 +2541,7 @@ exports[`Core System Prompt (prompts.ts) > should use chatty system prompt for p
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
<subagent>

View File

@@ -178,7 +178,7 @@ describe('Core System Prompt (prompts.ts)', () => {
expect(prompt).toContain('# Available Sub-Agents');
expect(prompt).toContain('<available_subagents>');
expect(prompt).toContain('<subagent>');
expect(prompt).toContain('<name>Test Agent</name>');
expect(prompt).toContain('<name>test-agent</name>');
expect(prompt).toContain(
'<description>A test agent description</description>',
);

View File

@@ -132,7 +132,7 @@ export class PromptProvider {
.getAgentRegistry()
.getAllDefinitions()
.map((d) => ({
name: d.displayName || d.name,
name: d.name,
description: d.description,
})),
),

View File

@@ -187,11 +187,7 @@ export function renderSubAgents(subAgents?: SubAgentOptions[]): string {
return `
# Available Sub-Agents
Sub-agents are specialized expert agents that you can use to assist you in the completion of all or part of a task.
Each sub-agent is available as a tool of the same name. You MUST always delegate tasks to the sub-agent with the relevant expertise, if one is available.
The following tools can be used to start sub-agents:
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.
<available_subagents>
${subAgentsXml}

View File

@@ -77,7 +77,7 @@ export function applySubstitutions(
.getAgentRegistry()
.getAllDefinitions()
.map((d) => ({
name: d.displayName || d.name,
name: d.name,
description: d.description,
})),
);