fix(review): surface per-model terminal errors and readable diagnostics in review-failure telemetry#8302
fix(review): surface per-model terminal errors and readable diagnostics in review-failure telemetry#8302JSONbored wants to merge 1 commit into
Conversation
…cs in review-failure telemetry The ai_review_provider_exhausted summary only carried the LAST error across all models x attempts, so a fallback's circuit_open masked the primary's distinct terminal failure (a rate-limit 429) during the 2026-07-23 outage (LOOPOVER-2A) -- the single Sentry event pointed at the wrong provider. runWorkersOpinion now also tracks each model's own terminal error and logs the map alongside the unchanged last-error field. Both captureReviewFailure sites passed raw AiReviewDiagnostic[] into Sentry context, where the SDK's default normalizeDepth flattened every entry to the literal string "[Object]" (LOOPOVER-2B), erasing the model/attempt/status/ error detail. formatReviewDiagnosticsForCapture renders them as compact model#attempt:status[:error] strings that survive normalization.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Logic backtestReplayed 0 historical case(s) for Backtest comparison:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8302 +/- ##
==========================================
- Coverage 92.17% 91.65% -0.53%
==========================================
Files 791 791
Lines 79245 79249 +4
Branches 23944 23946 +2
==========================================
- Hits 73044 72633 -411
- Misses 5062 5524 +462
+ Partials 1139 1092 -47
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-24 02:18:31 UTC
Review summary Nits — 1 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Two observability defects made the 2026-07-23 ORB review outage (every block-mode dual review inconclusive → "AI review could not be completed" holds) harder to diagnose from Sentry alone:
ai_review_provider_exhaustedmasked the primary's real failure. The exhausted summary only logged the LAST error across all models × attempts, so the fallback'scircuit_open(codex, structurally disabled) hid the primary's genuinely distinct terminal error (claude_code_error_429) — the single Sentry event pointed at the wrong provider (LOOPOVER-2A).runWorkersOpinionnow also tracks a per-model terminal-error map (errorsByModel) and includes it in the exhausted log. The existingerrorfield is unchanged, so Sentry grouping/fingerprints are unaffected.review_diagnosticsreached Sentry as unreadable"[Object]"entries. BothcaptureReviewFailuresites passed the rawAiReviewDiagnostic[]; the entries sit at normalize-depth 4, so the SDK's defaultnormalizeDepth: 3flattened each one to the literal string"[Object]", erasing exactly the model/attempt/status/error detail they exist to carry (LOOPOVER-2B). A newformatReviewDiagnosticsForCapturehelper renders them as compactmodel#attempt:status[:error]strings, which survive normalization verbatim. Theerrorfield iserrorMessage()output, never raw provider text, so the "withholds unsafe provider text" boundary is intact.Validation
npx vitest run test/unit/ai-review.test.ts test/unit/ai-review-advisory.test.ts— 264 passed, including:errorstays the last one;formatReviewDiagnosticsForCapturecases covering the with-error and without-error arms and the empty array.npm run typecheckclean.npm run test:coverage(unsharded) green.