Skip to content

fix(ai-review): mode-aware inconclusive copy + structural classification for claude-code auth errors - #8795

Merged
JSONbored merged 1 commit into
mainfrom
fix/inconclusive-copy-structural-classification
Jul 26, 2026
Merged

fix(ai-review): mode-aware inconclusive copy + structural classification for claude-code auth errors#8795
JSONbored merged 1 commit into
mainfrom
fix/inconclusive-copy-structural-classification

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

The other half of the inconclusive-verdict incident cleanup (sibling of #8794), closing the two alignment gaps found in the 2026-07-26 trace.

Changes

  • Mode-aware copyrunLoopOverAiReview's ok-result gains plannedReviewerCount: 1 | 2 (the resolved plan's independent reviewer slots; distinct from reviewerCount, which counts produced output and is 0 on a fully-failed run). The ai_review_inconclusive finding's detail now says "dual-model" only when a genuine two-reviewer plan ran, and "one reviewer, including its provider fallback chain" otherwise. The gate-level summaries (rules/advisory.ts + engine parity twin) were already mode-neutral and are untouched.
  • Structural classificationisStructuralProviderConfigError now matches claude_code_no_oauth_token / claude_code_error_401 / claude_code_error_403 alongside the codex shapes (fix(selfhost): validate AI reviewer-provider configuration and add a failure circuit breaker #2626 precedent): an expired/missing Claude Code credential is exactly as deterministic as codex_no_auth, so it earns the long structural circuit-breaker cooldown instead of burning the full retry budget on every review. claude_code_error_429 (rate limit — clears on its own, has its own break) and exit/stall shapes stay transient.

Test plan

  • npm run typecheck — clean
  • New tests: single-plan copy (via aiReviewCombine: "single"), dual-plan copy pinned, and 7 classifier cases (3 structural claude shapes bare + suffixed, 429/exit/stall non-matches)
  • 458 tests green across ai-review/advisory/selfhost-ai suites
  • Changed hunks: 0 uncovered statements/branches

Closes #8791

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Logic backtest

Replayed 0 historical case(s) for linked_issue_scope_mismatch through the base (7544cd3) and head (d2a14b8) versions of its detection logic (corpus checksum 4f53cda18c2b).

Backtest comparison: linked_issue_scope_mismatch

Verdict: unchanged — no comparable axis moved.

Advisory only — this check never blocks merge (#8105).

@JSONbored JSONbored self-assigned this Jul 26, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 2fa6c25 Commit Preview URL

Branch Preview URL
Jul 26 2026, 06:26 AM

…ion for claude-code auth errors (#8791)

Two alignment gaps from the 2026-07-26 inconclusive-verdict trace:

- The inconclusive finding unconditionally said "dual-model AI review" — on a
  single-reviewer-with-fallback deployment (the AI_PROVIDER=a,b default
  without AI_DUAL_REVIEW) that misdescribed a provider-chain outage as a
  two-model disagreement and sent the incident's debugging down the wrong
  path. The ok-result now carries plannedReviewerCount (the resolved plan's
  independent slots, distinct from reviewerCount's produced-output count) and
  the copy matches what actually ran.
- isStructuralProviderConfigError only matched codex_* auth shapes, so an
  expired Claude Code token (claude_code_no_oauth_token, claude_code_error_401/403)
  burned the full retry budget every review instead of earning the structural
  circuit-breaker cooldown. The claude-code shapes now join the codex ones;
  429s and exit/stall errors stay transient.
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 26, 2026
@loopover-orb

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Important

🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪

🔍 LoopOver is reviewing…

AI analysis is in progress. This comment will update when the review is complete.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing

@JSONbored
JSONbored force-pushed the fix/inconclusive-copy-structural-classification branch from 2fa6c25 to d2a14b8 Compare July 26, 2026 06:32
@JSONbored
JSONbored merged commit b0bdaaa into main Jul 26, 2026
3 checks passed
@JSONbored
JSONbored deleted the fix/inconclusive-copy-structural-classification branch July 26, 2026 06:33
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.26%. Comparing base (7544cd3) to head (d2a14b8).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8795      +/-   ##
==========================================
- Coverage   93.81%   92.26%   -1.55%     
==========================================
  Files         797      797              
  Lines       79606    79608       +2     
  Branches    24125    24127       +2     
==========================================
- Hits        74684    73453    -1231     
- Misses       3556     5090    +1534     
+ Partials     1366     1065     -301     
Flag Coverage Δ
backend 92.94% <100.00%> (-2.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/queue/ai-review-orchestration.ts 100.00% <100.00%> (ø)
src/services/ai-review.ts 97.15% <100.00%> (+<0.01%) ⬆️

... and 3 files with indirect coverage changes

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

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

1 participant