fix: improve logging in reduceAnswers function

This commit is contained in:
Han Xiao 2025-06-12 15:00:49 -07:00
parent 034e984d15
commit a6100b3713

View File

@ -73,8 +73,10 @@ export async function reduceAnswers(
trackers.tokenTracker.trackUsage(TOOL_NAME, result.usage)
logInfo(TOOL_NAME, { text: result.text });
logDebug(`reduce before/after: ${mdContent.length} -> ${result.text.length}`);
logDebug(`${TOOL_NAME} before/after: ${mdContent.length} -> ${result.text.length}`, {
originalContent: mdContent,
reducedContent: result.text
});
if (result.text.length < mdContent.length * 0.5) {
logWarning(`reduce content length ${result.text.length} is significantly shorter than original content ${mdContent.length}, return original content instead.`, {