mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 21:03:05 -07:00
feat(scheduler): support multi-scheduler tool aggregation and nested call IDs (#17429)
This commit is contained in:
@@ -17,6 +17,7 @@ import type {
|
||||
ExecutingToolCall,
|
||||
ToolCallResponseInfo,
|
||||
} from './types.js';
|
||||
import { ROOT_SCHEDULER_ID } from './types.js';
|
||||
import type {
|
||||
ToolConfirmationOutcome,
|
||||
ToolResultDisplay,
|
||||
@@ -39,7 +40,10 @@ export class SchedulerStateManager {
|
||||
private readonly queue: ToolCall[] = [];
|
||||
private _completedBatch: CompletedToolCall[] = [];
|
||||
|
||||
constructor(private readonly messageBus: MessageBus) {}
|
||||
constructor(
|
||||
private readonly messageBus: MessageBus,
|
||||
private readonly schedulerId: string = ROOT_SCHEDULER_ID,
|
||||
) {}
|
||||
|
||||
addToolCalls(calls: ToolCall[]): void {
|
||||
this.enqueue(calls);
|
||||
@@ -201,6 +205,7 @@ export class SchedulerStateManager {
|
||||
void this.messageBus.publish({
|
||||
type: MessageBusType.TOOL_CALLS_UPDATE,
|
||||
toolCalls: snapshot,
|
||||
schedulerId: this.schedulerId,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -321,6 +326,7 @@ export class SchedulerStateManager {
|
||||
response,
|
||||
durationMs: startTime ? Date.now() - startTime : undefined,
|
||||
outcome: call.outcome,
|
||||
schedulerId: call.schedulerId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -336,6 +342,7 @@ export class SchedulerStateManager {
|
||||
response,
|
||||
durationMs: startTime ? Date.now() - startTime : undefined,
|
||||
outcome: call.outcome,
|
||||
schedulerId: call.schedulerId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -364,6 +371,7 @@ export class SchedulerStateManager {
|
||||
startTime: 'startTime' in call ? call.startTime : undefined,
|
||||
outcome: call.outcome,
|
||||
invocation: call.invocation,
|
||||
schedulerId: call.schedulerId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -388,6 +396,7 @@ export class SchedulerStateManager {
|
||||
startTime: 'startTime' in call ? call.startTime : undefined,
|
||||
outcome: call.outcome,
|
||||
invocation: call.invocation,
|
||||
schedulerId: call.schedulerId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -442,6 +451,7 @@ export class SchedulerStateManager {
|
||||
},
|
||||
durationMs: startTime ? Date.now() - startTime : undefined,
|
||||
outcome: call.outcome,
|
||||
schedulerId: call.schedulerId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -462,6 +472,7 @@ export class SchedulerStateManager {
|
||||
startTime: 'startTime' in call ? call.startTime : undefined,
|
||||
outcome: call.outcome,
|
||||
invocation: call.invocation,
|
||||
schedulerId: call.schedulerId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -482,6 +493,7 @@ export class SchedulerStateManager {
|
||||
invocation: call.invocation,
|
||||
liveOutput,
|
||||
pid,
|
||||
schedulerId: call.schedulerId,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user