Repository navigation
fix: retry next provider on unusable model output, log why providers fail - #6
Merged
Merged
Conversation
The fallback warning said only 'rate-limited or error', hiding why groq-1, groq-2 and openrouter-gemma fail on every audit.
A reasoning/prose response was turned into a fake 50-point result and shipped. Parse tolerantly (think blocks, fences, surrounding prose), throw on garbage so withFallback tries the next provider, mark dimensions that fail everywhere and leave them out of the overall score, and stop early when the first dimension fails.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Owner
Author
|
The Vercel preview check is red with Generated by Claude Code |
riteshbonthalakoti
marked this pull request as ready for review
November 3, 2026 09:28
This was referenced Nov 3, 2026
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
After #2 was deployed, audits complete again but production still returns junk:
groq-1,groq-2andopenrouter-gemmafail on every call, and the log only said "rate-limited or error".withFallbacknow logs the status and a redacted, truncated message (keys matchinggsk_/sk-/fc-are masked) so the cause is visible in Vercel logs.openrouter-nemotron(the provider that finally answers) returns output the parser rejects, andanalyzeDimensionturned that into a fakescore: 50"unexpected format" result that was shipped as the audit. Now:<think>blocks, code fences and prose around the JSON, and validatesscoreandfindingswithFallbacktries the next providerfailedand excluded from the overall scoremax_tokensraised from 1000 to 1800 so reasoning models are less likely to be cut off before the JSONWhy
Verified live after #2 deployed: a free audit of example.com returned three dimensions all scored 50 with "Analysis returned an unexpected format", provider
openrouter-nemotron, total 61s.Type
Checklist
npx tsc --noEmitandnpx eslintpassanalyzetests on the test-coverage branch (test: add Vitest suite covering AI fallback, rate limiter, audit scoring, admin auth #1) assume the old fake-50 fallback and will need updating after this mergesnpm run buildnot run here (sandbox lacks Stripe/Resend env vars; see test: add Vitest suite covering AI fallback, rate limiter, audit scoring, admin auth #1)