File: src/lib/parsers/default/utils/summarizeLargeFiles.ts:302, summarizeDiffs.ts:133
What's wrong: both catch blocks return the original (unsummarized) diff and report via
bare console.error, so the failure never reaches the logger, never respects --quiet, and
never surfaces as a warning the caller can attach to the result.
Evidence:
} catch (error) {
// On error, return original diff unchanged
console.error(`Failed to summarize file ${fileDiff.file}:`, error)
return fileDiff
}
Impact: silent degradation with a real consequence — returning the unsummarized diff
is precisely what blows the token budget the summarizer exists to protect, so a run that
silently loses every summarization ends up trimming real content in
enforcePromptBudget instead. The logger is already threaded into both functions'
options, so the correct channel is in hand.
Suggested fix: use the injected logger.verbose/logger.warn, and count failures so
the caller can report "summarization degraded for N files".
Confidence: high
Extracted from a repo audit performed 2026-07 (the audit doc it came from was proposed via an unmerged docs PR).
File:
src/lib/parsers/default/utils/summarizeLargeFiles.ts:302,summarizeDiffs.ts:133What's wrong: both catch blocks return the original (unsummarized) diff and report via
bare
console.error, so the failure never reaches the logger, never respects--quiet, andnever surfaces as a warning the caller can attach to the result.
Evidence:
Impact: silent degradation with a real consequence — returning the unsummarized diff
is precisely what blows the token budget the summarizer exists to protect, so a run that
silently loses every summarization ends up trimming real content in
enforcePromptBudgetinstead. Theloggeris already threaded into both functions'options, so the correct channel is in hand.
Suggested fix: use the injected
logger.verbose/logger.warn, and count failures sothe caller can report "summarization degraded for N files".
Confidence: high
Extracted from a repo audit performed 2026-07 (the audit doc it came from was proposed via an unmerged docs PR).