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

@@ -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 };