extract console error to util func (#11675)

This commit is contained in:
Abhi
2025-10-22 16:09:10 -04:00
committed by GitHub
parent a7faa2080f
commit b40f67b76a
9 changed files with 19 additions and 63 deletions

View File

@@ -107,10 +107,6 @@ describe('summarizers', () => {
expect(mockGeminiClient.generateContent).toHaveBeenCalledTimes(1);
expect(result).toBe(longText);
expect(console.error).toHaveBeenCalledWith(
'Failed to summarize tool output.',
error,
);
});
it('should construct the correct prompt for summarization', async () => {

View File

@@ -13,6 +13,7 @@ import type {
import type { GeminiClient } from '../core/client.js';
import { DEFAULT_GEMINI_FLASH_LITE_MODEL } from '../config/models.js';
import { getResponseText, partToString } from './partUtils.js';
import { debugLogger } from './debugLogger.js';
/**
* A function that summarizes the result of a tool execution.
@@ -90,7 +91,7 @@ export async function summarizeToolOutput(
)) as unknown as GenerateContentResponse;
return getResponseText(parsedResponse) || textToSummarize;
} catch (error) {
console.error('Failed to summarize tool output.', error);
debugLogger.warn('Failed to summarize tool output.', error);
return textToSummarize;
}
}