Fix tool output fragmentation by encapsulating content in functionResponse (#13082)

This commit is contained in:
Abhi
2025-12-15 15:36:34 -05:00
committed by GitHub
parent 13944b9bb1
commit d236df5b21
8 changed files with 276 additions and 83 deletions

View File

@@ -33,6 +33,7 @@ import {
ApprovalMode,
MockTool,
HookSystem,
PREVIEW_GEMINI_MODEL,
} from '@google/gemini-cli-core';
import { createMockMessageBus } from '@google/gemini-cli-core/src/test-utils/mock-message-bus.js';
import { ToolCallStatus } from '../types.js';
@@ -71,6 +72,7 @@ const mockConfig = {
getTruncateToolOutputThreshold: () => DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
getTruncateToolOutputLines: () => DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
getAllowedTools: vi.fn(() => []),
getActiveModel: () => PREVIEW_GEMINI_MODEL,
getContentGeneratorConfig: () => ({
model: 'test-model',
authType: 'oauth-personal',

View File

@@ -497,7 +497,12 @@ export class Session {
),
);
return convertToFunctionResponse(fc.name, callId, toolResult.llmContent);
return convertToFunctionResponse(
fc.name,
callId,
toolResult.llmContent,
this.config.getActiveModel(),
);
} catch (e) {
const error = e instanceof Error ? e : new Error(String(e));