Refactor subagent delegation to be one tool per agent (#17346)

This commit is contained in:
Christian Gunderman
2026-01-23 02:18:31 +00:00
committed by GitHub
parent 07bd89399d
commit 2c6781d134
18 changed files with 247 additions and 720 deletions
+8 -14
View File
@@ -943,10 +943,10 @@ describe('AgentRegistry', () => {
});
});
describe('getToolDescription', () => {
describe('getDirectoryContext', () => {
it('should return default message when no agents are registered', () => {
expect(registry.getToolDescription()).toContain(
'No agents are currently available',
expect(registry.getDirectoryContext()).toContain(
'No sub-agents are currently available.',
);
});
@@ -958,18 +958,12 @@ describe('AgentRegistry', () => {
description: 'Another agent description',
});
const description = registry.getToolDescription();
const description = registry.getDirectoryContext();
expect(description).toContain(
'Delegates a task to a specialized sub-agent',
);
expect(description).toContain('Available agents:');
expect(description).toContain(
`- **${MOCK_AGENT_V1.name}**: ${MOCK_AGENT_V1.description}`,
);
expect(description).toContain(
`- **AnotherAgent**: Another agent description`,
);
expect(description).toContain('Sub-agents are specialized expert agents');
expect(description).toContain('Available Sub-Agents');
expect(description).toContain(`- ${MOCK_AGENT_V1.name}`);
expect(description).toContain(`- AnotherAgent`);
});
});
});