fix(review): stop logging raw unparseable AI output - #5147
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5147 +/- ##
==========================================
- Coverage 94.21% 94.21% -0.01%
==========================================
Files 470 470
Lines 39743 39741 -2
Branches 14506 14506
==========================================
- Hits 37442 37440 -2
Misses 1645 1645
Partials 656 656
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 09:00:01 UTC
⏸️ Suggested Action - Manual Review
Review summary Blockers
Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory 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://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
|
Closing: this reverses #5071/#5073 (merged earlier this session), which added the response-snippet log specifically to diagnose a live, still-firing Sentry issue (ai_review_provider_unparseable_exhausted, unactionable since 2026-07-01 without it). The stated motivation — preventing raw provider output from reaching Sentry — was already the design: the snippet is capped at 400 chars, deliberately excluded from the public/Sentry-facing reviewDiagnostics array, and reaches only the internal structured-log forwarder (the same self-host-operator-owned Sentry instance, not a third-party sink — same reasoning as closing #5111). Keeping the diagnostic snippet. |
Motivation
responseSnippetfield from structured logs and diagnostics.Description
responseSnippetfrom unparseable model responses by removing the snippet field and its size cap usage fromrunWorkersOpinioninsrc/services/ai-review.ts.responseCharsandhasJsonObjectin per-attemptwarnlogs and the finalerrorexhaustion log while omitting any raw provider text.lastUnparseableshape to no longer carryresponseSnippetand remove theUNPARSEABLE_RESPONSE_SNIPPET_MAX_CHARSusage from logging paths.test/unit/ai-review.test.tsto assert that diagnostics and structured log payloads do not containresponseSnippetand continue to validateresponseChars/hasJsonObjectmetadata.Testing
npx vitest run test/unit/ai-review.test.ts -t "unparseable"which passed the targeted tests.npx vitest run test/unit/ai-review.test.tsand the ai-review unit suite passed (all tests in that file succeeded).npm run typecheckwhich completed successfully.npm run test:coveragebut the local full-suite coverage run surfaced unrelated existing failures intest/unit/queue-5.test.tsso the unsharded coverage run could not be completed end-to-end locally; the change’s targeted tests were exercised and pass.npm audit --audit-level=moderatebut the audit endpoint returned403 Forbidden(external limitation).Codex Task