mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-28 23:11:19 -07:00
feat: Add enableSubagents configuration and wire up subagent registration (#9988)
This commit is contained in:
@@ -16,6 +16,7 @@ import { AgentTerminateMode } from './types.js';
|
||||
import { makeFakeConfig } from '../test-utils/config.js';
|
||||
import { ToolErrorType } from '../tools/tool-error.js';
|
||||
import type { Config } from '../config/config.js';
|
||||
import type { MessageBus } from '../confirmation-bus/message-bus.js';
|
||||
|
||||
vi.mock('./executor.js');
|
||||
|
||||
@@ -52,6 +53,21 @@ describe('SubagentInvocation', () => {
|
||||
MockAgentExecutor.create.mockResolvedValue(mockExecutorInstance);
|
||||
});
|
||||
|
||||
it('should pass the messageBus to the parent constructor', () => {
|
||||
const mockMessageBus = {} as MessageBus;
|
||||
const params = { task: 'Analyze data' };
|
||||
const invocation = new SubagentInvocation(
|
||||
params,
|
||||
testDefinition,
|
||||
mockConfig,
|
||||
mockMessageBus,
|
||||
);
|
||||
|
||||
// Access the protected messageBus property by casting to any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((invocation as any).messageBus).toBe(mockMessageBus);
|
||||
});
|
||||
|
||||
describe('getDescription', () => {
|
||||
it('should format the description with inputs', () => {
|
||||
const params = { task: 'Analyze data', priority: 5 };
|
||||
|
||||
Reference in New Issue
Block a user