feat(scheduler): support multi-scheduler tool aggregation and nested call IDs (#17429)

This commit is contained in:
Abhi
2026-01-26 13:38:11 -05:00
committed by GitHub
parent 3e1a377d78
commit d745d86af1
9 changed files with 241 additions and 23 deletions
@@ -29,6 +29,7 @@ import {
import type { SchedulerStateManager } from './state-manager.js';
import type { ToolModificationHandler } from './tool-modifier.js';
import type { ValidatingToolCall, WaitingToolCall } from './types.js';
import { ROOT_SCHEDULER_ID } from './types.js';
import type { Config } from '../config/config.js';
import type { EditorType } from '../utils/editor.js';
import { randomUUID } from 'node:crypto';
@@ -52,7 +53,7 @@ describe('confirmation.ts', () => {
});
afterEach(() => {
vi.clearAllMocks();
vi.restoreAllMocks();
});
const emitResponse = (response: ToolConfirmationResponse) => {
@@ -188,6 +189,7 @@ describe('confirmation.ts', () => {
state: mockState,
modifier: mockModifier,
getPreferredEditor,
schedulerId: ROOT_SCHEDULER_ID,
});
expect(result.outcome).toBe(ToolConfirmationOutcome.ProceedOnce);
@@ -217,6 +219,7 @@ describe('confirmation.ts', () => {
state: mockState,
modifier: mockModifier,
getPreferredEditor,
schedulerId: ROOT_SCHEDULER_ID,
});
await listenerPromise;
@@ -252,6 +255,7 @@ describe('confirmation.ts', () => {
state: mockState,
modifier: mockModifier,
getPreferredEditor,
schedulerId: ROOT_SCHEDULER_ID,
});
await waitForListener(MessageBusType.TOOL_CONFIRMATION_RESPONSE);
@@ -293,6 +297,7 @@ describe('confirmation.ts', () => {
state: mockState,
modifier: mockModifier,
getPreferredEditor,
schedulerId: ROOT_SCHEDULER_ID,
});
await listenerPromise1;
@@ -351,6 +356,7 @@ describe('confirmation.ts', () => {
state: mockState,
modifier: mockModifier,
getPreferredEditor,
schedulerId: ROOT_SCHEDULER_ID,
});
await listenerPromise;
@@ -397,6 +403,7 @@ describe('confirmation.ts', () => {
state: mockState,
modifier: mockModifier,
getPreferredEditor,
schedulerId: ROOT_SCHEDULER_ID,
});
const result = await promise;
@@ -420,6 +427,7 @@ describe('confirmation.ts', () => {
state: mockState,
modifier: mockModifier,
getPreferredEditor,
schedulerId: ROOT_SCHEDULER_ID,
}),
).rejects.toThrow(/lost during confirmation loop/);
});