feat: Add enableSubagents configuration and wire up subagent registration (#9988)

This commit is contained in:
Abhi
2025-10-01 16:54:00 -04:00
committed by GitHub
parent 5b16771567
commit 331ae7dbdf
14 changed files with 352 additions and 39 deletions

View File

@@ -12,6 +12,7 @@ import { makeFakeConfig } from '../test-utils/config.js';
import type { AgentDefinition, AgentInputs } from './types.js';
import type { Config } from '../config/config.js';
import { Kind } from '../tools/tools.js';
import type { MessageBus } from '../confirmation-bus/message-bus.js';
// Mock dependencies to isolate the SubagentToolWrapper class
vi.mock('./invocation.js');
@@ -119,6 +120,26 @@ describe('SubagentToolWrapper', () => {
params,
mockDefinition,
mockConfig,
undefined,
);
});
it('should pass the messageBus to the SubagentInvocation constructor', () => {
const mockMessageBus = {} as MessageBus;
const wrapper = new SubagentToolWrapper(
mockDefinition,
mockConfig,
mockMessageBus,
);
const params: AgentInputs = { goal: 'Test the invocation', priority: 1 };
wrapper.build(params);
expect(MockedSubagentInvocation).toHaveBeenCalledWith(
params,
mockDefinition,
mockConfig,
mockMessageBus,
);
});