Skip to content

Review pipeline silently degrades on RAG / enrichment / inline-comment failures (not surfaced to Sentry) #1618

Description

@JSONbored

Problem

Several review-pipeline failure points are caught + swallowed and were invisible to the central Sentry forwarder (which captures level:error/fatal structured logs):

  • RAG retrieval (retrieveContext, rag.ts:409) logs rag_retrieve_error via console.log with no level field → a down qdrant/embedder silently degrades reviews to diff-only, invisible in Sentry.
  • REES enrichment (buildReviewEnrichment catch) swallows fetch/timeout/parse errors → the brief silently drops, invisible.
  • Inline review comments (postInlineReviewComments catch) logged the post failure at warn → skipped by the forwarder.

These compound the diagnosis pain seen with the recent #1610 outage: a degrading reviewer with no Sentry signal.

Fix

Emit these at level:error so the forwarder captures them (no forwarder change needed):

  • rag.ts: review_context_fetch_failed (contextType: rag) at the existing retrieve catch.
  • enrichment-wire.ts: review_context_fetch_failed (contextType: enrichment) in the catch.
  • inline-comments.ts: inline_comments_post_failed warn → error.

Each is fail-safe (the review still proceeds); only the visibility changes. Regression tests pin that each surfaces at error.

Note: grounding-wire and rag-wire's outer catches are intentionally left alone — their inner code is fail-safe so those catches are unreachable; the real failure point for RAG is inside retrieveContext.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions