feat(core): Save large tool outputs to a file and return truncated lines (#6240)

This commit is contained in:
Sandy Tao
2025-09-05 15:37:29 -07:00
committed by GitHub
parent 7239c5cd9a
commit dd23c77469
14 changed files with 511 additions and 10 deletions

View File

@@ -9,8 +9,12 @@ import type {
TaskStatusUpdateEvent,
SendStreamingMessageSuccessResponse,
} from '@a2a-js/sdk';
import { ApprovalMode } from '@google/gemini-cli-core';
import type { Config } from '@google/gemini-cli-core';
import {
ApprovalMode,
DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
} from '@google/gemini-cli-core';
import type { Config, Storage } from '@google/gemini-cli-core';
import { expect, vi } from 'vitest';
export function createMockConfig(
@@ -28,6 +32,12 @@ export function createMockConfig(
isPathWithinWorkspace: () => true,
}),
getTargetDir: () => '/test',
storage: {
getProjectTempDir: () => '/tmp',
} as Storage,
getTruncateToolOutputThreshold: () =>
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
getTruncateToolOutputLines: () => DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
getGeminiClient: vi.fn(),
getDebugMode: vi.fn().mockReturnValue(false),
getContentGeneratorConfig: vi.fn().mockReturnValue({ model: 'gemini-pro' }),