mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 13:34:15 -07:00
refactor(cli): decouple UI from live tool execution via ToolActionsContext (#17183)
This commit is contained in:
@@ -195,6 +195,33 @@ describe('toolMapping', () => {
|
||||
expect(displayTool.confirmationDetails).toEqual(confirmationDetails);
|
||||
});
|
||||
|
||||
it('maps correlationId and serializable confirmation details', () => {
|
||||
const serializableDetails = {
|
||||
type: 'edit' as const,
|
||||
title: 'Confirm Edit',
|
||||
fileName: 'file.txt',
|
||||
filePath: '/path/file.txt',
|
||||
fileDiff: 'diff',
|
||||
originalContent: 'old',
|
||||
newContent: 'new',
|
||||
};
|
||||
|
||||
const toolCall: WaitingToolCall = {
|
||||
status: 'awaiting_approval',
|
||||
request: mockRequest,
|
||||
tool: mockTool,
|
||||
invocation: mockInvocation,
|
||||
confirmationDetails: serializableDetails,
|
||||
correlationId: 'corr-123',
|
||||
};
|
||||
|
||||
const result = mapToDisplay(toolCall);
|
||||
const displayTool = result.tools[0];
|
||||
|
||||
expect(displayTool.correlationId).toBe('corr-123');
|
||||
expect(displayTool.confirmationDetails).toEqual(serializableDetails);
|
||||
});
|
||||
|
||||
it('maps error tool call missing tool definition', () => {
|
||||
// e.g. "TOOL_NOT_REGISTERED" errors
|
||||
const toolCall: ToolCall = {
|
||||
|
||||
Reference in New Issue
Block a user