mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-16 17:11:04 -07:00
refactor: use CoreToolCallStatus in the the history data model (#19033)
This commit is contained in:
@@ -75,12 +75,12 @@ import {
|
||||
type GeminiClient,
|
||||
type ShellExecutionResult,
|
||||
type ShellOutputEvent,
|
||||
CoreToolCallStatus,
|
||||
} from '@google/gemini-cli-core';
|
||||
import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
import * as crypto from 'node:crypto';
|
||||
import { ToolCallStatus } from '../types.js';
|
||||
|
||||
describe('useShellCommandProcessor', () => {
|
||||
let addItemToHistoryMock: Mock;
|
||||
@@ -201,7 +201,7 @@ describe('useShellCommandProcessor', () => {
|
||||
tools: [
|
||||
expect.objectContaining({
|
||||
name: 'Shell Command',
|
||||
status: ToolCallStatus.Executing,
|
||||
status: CoreToolCallStatus.Executing,
|
||||
}),
|
||||
],
|
||||
});
|
||||
@@ -240,7 +240,7 @@ describe('useShellCommandProcessor', () => {
|
||||
expect.objectContaining({
|
||||
tools: [
|
||||
expect.objectContaining({
|
||||
status: ToolCallStatus.Success,
|
||||
status: CoreToolCallStatus.Success,
|
||||
resultDisplay: 'ok',
|
||||
}),
|
||||
],
|
||||
@@ -269,7 +269,7 @@ describe('useShellCommandProcessor', () => {
|
||||
await act(async () => await execPromise);
|
||||
|
||||
const finalHistoryItem = addItemToHistoryMock.mock.calls[1][0];
|
||||
expect(finalHistoryItem.tools[0].status).toBe(ToolCallStatus.Error);
|
||||
expect(finalHistoryItem.tools[0].status).toBe(CoreToolCallStatus.Error);
|
||||
expect(finalHistoryItem.tools[0].resultDisplay).toContain(
|
||||
'Command exited with code 127',
|
||||
);
|
||||
@@ -483,7 +483,7 @@ describe('useShellCommandProcessor', () => {
|
||||
await act(async () => await execPromise);
|
||||
|
||||
const finalHistoryItem = addItemToHistoryMock.mock.calls[1][0];
|
||||
expect(finalHistoryItem.tools[0].status).toBe(ToolCallStatus.Success);
|
||||
expect(finalHistoryItem.tools[0].status).toBe(CoreToolCallStatus.Success);
|
||||
expect(finalHistoryItem.tools[0].resultDisplay).toBe(
|
||||
'[Command produced binary output, which is not shown.]',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user