feat(core): Enable generalist agent (#19665)

This commit is contained in:
joshualitt
2026-02-26 08:38:49 -08:00
committed by GitHub
parent bc21652878
commit 325c8683db
6 changed files with 547 additions and 9 deletions

View File

@@ -24,8 +24,7 @@ export const GeneralistAgent = (
name: 'generalist',
displayName: 'Generalist Agent',
description:
"A general-purpose AI agent with access to all tools. Use it for complex tasks that don't fit into other specialized agents.",
experimental: true,
'A general-purpose AI agent with access to all tools. Highly recommended for tasks that are turn-intensive or involve processing large amounts of data. Use this to keep the main session history lean and efficient. Excellent for: batch refactoring/error fixing across multiple files, running commands with high-volume output, and speculative investigations.',
inputConfig: {
inputSchema: {
type: 'object',

View File

@@ -50,6 +50,7 @@ function makeMockedConfig(params?: Partial<ConfigParameters>): Config {
} as unknown as ToolRegistry);
vi.spyOn(config, 'getAgentRegistry').mockReturnValue({
getDirectoryContext: () => 'mock directory context',
getAllDefinitions: () => [],
} as unknown as AgentRegistry);
return config;
}
@@ -262,6 +263,7 @@ describe('AgentRegistry', () => {
overrides: {
codebase_investigator: { enabled: false },
cli_help: { enabled: false },
generalist: { enabled: false },
},
},
});
@@ -299,13 +301,13 @@ describe('AgentRegistry', () => {
expect(registry.getDefinition('cli_help')).toBeUndefined();
});
it('should NOT register generalist agent by default (because it is experimental)', async () => {
it('should register generalist agent by default', async () => {
const config = makeMockedConfig();
const registry = new TestableAgentRegistry(config);
await registry.initialize();
expect(registry.getDefinition('generalist')).toBeUndefined();
expect(registry.getDefinition('generalist')).toBeDefined();
});
it('should register generalist agent if explicitly enabled via override', async () => {