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
@@ -531,11 +531,7 @@ exports[`Core System Prompt (prompts.ts) > should append userMemory with separat
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
<subagent> <subagent>
@@ -1312,11 +1308,7 @@ exports[`Core System Prompt (prompts.ts) > should include correct sandbox instru
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
<subagent> <subagent>
@@ -1429,11 +1421,7 @@ exports[`Core System Prompt (prompts.ts) > should include correct sandbox instru
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
<subagent> <subagent>
@@ -1546,11 +1534,7 @@ exports[`Core System Prompt (prompts.ts) > should include correct sandbox instru
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
<subagent> <subagent>
@@ -1771,15 +1755,11 @@ exports[`Core System Prompt (prompts.ts) > should include sub-agents in XML for
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
<subagent> <subagent>
<name>Test Agent</name> <name>test-agent</name>
<description>A test agent description</description> <description>A test agent description</description>
</subagent> </subagent>
</available_subagents> </available_subagents>
@@ -2123,11 +2103,7 @@ exports[`Core System Prompt (prompts.ts) > should return the base prompt when us
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
<subagent> <subagent>
@@ -2236,11 +2212,7 @@ exports[`Core System Prompt (prompts.ts) > should return the base prompt when us
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
<subagent> <subagent>
@@ -2460,11 +2432,7 @@ exports[`Core System Prompt (prompts.ts) > should use chatty system prompt for p
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
<subagent> <subagent>
@@ -2573,11 +2541,7 @@ exports[`Core System Prompt (prompts.ts) > should use chatty system prompt for p
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
<subagent> <subagent>
+1 -1
View File
@@ -178,7 +178,7 @@ describe('Core System Prompt (prompts.ts)', () => {
expect(prompt).toContain('# Available Sub-Agents'); expect(prompt).toContain('# Available Sub-Agents');
expect(prompt).toContain('<available_subagents>'); expect(prompt).toContain('<available_subagents>');
expect(prompt).toContain('<subagent>'); expect(prompt).toContain('<subagent>');
expect(prompt).toContain('<name>Test Agent</name>'); expect(prompt).toContain('<name>test-agent</name>');
expect(prompt).toContain( expect(prompt).toContain(
'<description>A test agent description</description>', '<description>A test agent description</description>',
); );
+1 -1
View File
@@ -132,7 +132,7 @@ export class PromptProvider {
.getAgentRegistry() .getAgentRegistry()
.getAllDefinitions() .getAllDefinitions()
.map((d) => ({ .map((d) => ({
name: d.displayName || d.name, name: d.name,
description: d.description, description: d.description,
})), })),
), ),
+1 -5
View File
@@ -187,11 +187,7 @@ export function renderSubAgents(subAgents?: SubAgentOptions[]): string {
return ` return `
# Available Sub-Agents # 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. 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.
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:
<available_subagents> <available_subagents>
${subAgentsXml} ${subAgentsXml}
+1 -1
View File
@@ -77,7 +77,7 @@ export function applySubstitutions(
.getAgentRegistry() .getAgentRegistry()
.getAllDefinitions() .getAllDefinitions()
.map((d) => ({ .map((d) => ({
name: d.displayName || d.name, name: d.name,
description: d.description, description: d.description,
})), })),
); );