feat: reliability hardening for Groq client (P1) - #10
Merged
Conversation
- Add exponential backoff with equal jitter between retries (was tight-loop, no delay). - Retry on HTTP 429 (rate limit), honoring Retry-After / retry-after-ms headers. - Source response modelName from GroqClient.getModel() as the single source of truth, instead of a hardcoded AnalysisService constant that could drift from the configured groq.api.model. - Add GroqClientTest (mocked HttpClient, tiny backoff) covering 2xx, 5xx/429/ IOException retry, 4xx no-retry, and attempt exhaustion; add AnalysisService test asserting modelName comes from config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…able A non-2xx response (e.g. an offline ngrok tunnel returning ERR_NGROK_3200) previously failed the PR check with exit 1. Now it logs a warning, posts an advisory comment (overallRisk=UNKNOWN) and exits 0, so an ephemeral dev service can never block a PR. Pair with an ngrok reserved domain to keep BLAST_RADIUS_URL stable across restarts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
💥 Blast Radius AnalysisOverall Risk: ❓ UNKNOWN 🔍 Impact Areas
🧪 Suggested Tests
Analyzed by Blast Radius (Spring Boot + Groq LLM) • 2026-06-15 |
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.
Summary
P1 reliability hardening for the Groq integration, stacked on the P0 security work already on
main.GroqClientpreviously retried in a tight loop with no delay. Now uses exponential backoff with equal jitter ([cap/2, cap], cap doubling per attempt up to 8s) so concurrent callers don't stampede a recovering upstream. Interrupt-safe sleeps.Retry-After/retry-after-msheaders (capped), falling back to backoff when absent.modelNamesingle source of truth — removed the hardcodedMODEL_NAMEconstant inAnalysisServicethat duplicated (and could drift from)groq.api.model. The reported model now comes fromGroqClient.getModel().Testing
GroqClienttestable via a package-private constructor (injectableHttpClient+ backoff bounds).GroqClientTest(8 cases): success, 5xx/429/IOException retry, 4xx no-retry,Retry-Afterparsing, attempt exhaustion.AnalysisServiceTestcase assertingmodelNameis sourced from config.GoldenDiffTestexcluded — requires a realGROQ_API_KEY+ network).