mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-08 20:30:53 -07:00
feat: Add enableSubagents configuration and wire up subagent registration (#9988)
This commit is contained in:
@@ -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,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user