mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
fix: Chat logs and errors handle tail tool calls correctly (#22460)
Co-authored-by: Abhi <43648792+abhipatel12@users.noreply.github.com>
This commit is contained in:
@@ -44,6 +44,8 @@ describe('SchedulerStateManager', () => {
|
||||
|
||||
const mockInvocation = {
|
||||
shouldConfirmExecute: vi.fn(),
|
||||
execute: vi.fn(),
|
||||
getDescription: vi.fn(),
|
||||
} as unknown as AnyToolInvocation;
|
||||
|
||||
const createValidatingCall = (
|
||||
@@ -610,6 +612,19 @@ describe('SchedulerStateManager', () => {
|
||||
expect(onUpdate).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('should use originalRequestName when cancelling queued calls', () => {
|
||||
const call = createValidatingCall('tail-1');
|
||||
call.request.originalRequestName = 'original-tool';
|
||||
stateManager.enqueue([call]);
|
||||
|
||||
stateManager.cancelAllQueued('Batch cancel');
|
||||
|
||||
const completed = stateManager.completedBatch[0] as CancelledToolCall;
|
||||
expect(completed.response.responseParts[0]?.functionResponse?.name).toBe(
|
||||
'original-tool',
|
||||
);
|
||||
});
|
||||
|
||||
it('should not notify if cancelAllQueued is called on an empty queue', () => {
|
||||
vi.mocked(onUpdate).mockClear();
|
||||
stateManager.cancelAllQueued('Batch cancel');
|
||||
|
||||
Reference in New Issue
Block a user