fix adapter undefined

This commit is contained in:
LaZzyMan 2026-01-26 19:53:02 +08:00
parent 650c625d86
commit 8794678c62
6 changed files with 137 additions and 121 deletions

View file

@ -984,26 +984,6 @@ describe('createTaskToolProgressHandler', () => {
expect(mockAdapter.emitToolResult).not.toHaveBeenCalled();
});
it('should work without adapter (non-JSON mode)', () => {
const { handler } = createTaskToolProgressHandler(
mockConfig,
'parent-tool-id',
undefined,
);
const taskDisplay: TaskResultDisplay = {
type: 'task_execution',
subagentName: 'test-agent',
taskDescription: 'Test task',
taskPrompt: 'Test prompt',
status: 'running',
toolCalls: [],
};
// Should not throw
expect(() => handler('task-call-id', taskDisplay)).not.toThrow();
});
it('should work with adapter that does not support subagent APIs', () => {
const limitedAdapter = {
emitToolResult: vi.fn(),