fix: subagent filename vs agent name mismatch handle

This commit is contained in:
tanzhenxin
2025-09-11 15:53:29 +08:00
parent d0735e8eb4
commit a7d69692fd
4 changed files with 359 additions and 84 deletions

View File

@@ -519,10 +519,11 @@ describe('subagent.ts', () => {
canUpdateOutput: false,
isOutputMarkdown: true,
} as unknown as AnyDeclarativeTool;
vi.mocked((config.getToolRegistry() as unknown as ToolRegistry).getTool)
.mockImplementation((name: string) =>
name === 'list_files' ? listFilesTool : undefined,
);
vi.mocked(
(config.getToolRegistry() as unknown as ToolRegistry).getTool,
).mockImplementation((name: string) =>
name === 'list_files' ? listFilesTool : undefined,
);
const scope = await SubAgentScope.create(
'test-agent',
@@ -546,8 +547,6 @@ describe('subagent.ts', () => {
expect(scope.getTerminateMode()).toBe(SubagentTerminateMode.GOAL);
});
});
describe('runNonInteractive - Termination and Recovery', () => {