Repository navigation
fix: audits abort when a provider times out (regression from #8) - #9
Merged
Merged
Conversation
APIConnectionTimeoutError/APIConnectionError extend APIError with status undefined, so isRetryableError returned false and a single slow provider aborted the whole audit. This surfaced once the client got a 30s timeout. Timeouts now fall through to the next provider and put the slow one on a 60s cooldown. A non-retryable failure now logs which provider it came from.
Per Groq's reasoning docs, reasoning_effort 'none' selects instruct mode (no
thinking) and reasoning_format must be 'hidden' or 'parsed' with JSON mode
('raw', the default, returns a 400). Providers can now carry extra request
fields; only Groq sets them.
|
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
|
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
Regression fix for something I introduced in #8. After #8 deployed, a live audit of vercel.com returned "Something broke on our side" after 52s. The log has a single
[analyze] failed: Error: Request timed outand no per-provider line.Cause:
APIConnectionTimeoutErrorandAPIConnectionErrorextendAPIErrorwithstatus: undefined, soisRetryableErrorreturnedfalsefor them ("fail fast"), and one slow provider aborted the whole audit instead of falling through. It was latent until #8 added a 30s client timeout; the SDK default is 10 minutes. The Groq call (first in the chain) timed out, most likely becauseqwen/qwen3.8-27bwas thinking by default.Changes:
reasoning_effort: "none"(instruct mode, no thinking) andreasoning_format: "hidden". Per Groq's reasoning docs,reasoning_formatmust behiddenorparsedwith JSON mode (raw, the default, returns a 400), andnoneis supported by Qwen 3.8 27B. Providers can carry extra request fields; only Groq sets them.Type
Checklist
npx tsc --noEmitandnpx eslint lib/aipassqwen/qwen3.8-27b,reasoning_effort: none,reasoning_format: hidden,response_format: json_object,max_tokens: 3000; when Groq fails with a network error the audit completes through OpenRouter; OpenRouter requests carry none of the Groq-only fieldsnpm 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)