Skip to content

LIB-11: fix(parsers): summarization failures are swallowed to console.error, bypassing the logger #1931

Description

@gfargo

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions