Skip to content

fix(ai): retry transient form-prefill provider failures - #850

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/ai-form-prefill-transient-retry
Aug 29, 2026
Merged

fix(ai): retry transient form-prefill provider failures#850
github-actions[bot] merged 1 commit into
mainfrom
fix/ai-form-prefill-transient-retry

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

Summary

  • Visitor feedback on /dashboard/projects/create: "Fill with AI" surfaced "AI service temporarily unavailable" on a single 429/5xx from the upstream provider (Groq/OpenRouter), and manually re-clicking usually worked.
  • generateFormPrefill (src/lib/ai/form-prefill-service.ts) now retries the upstream call via the existing withApiRetry backoff helper (already used elsewhere in the codebase) before surfacing the "temporarily unavailable" error, so a transient hiccup recovers automatically instead of requiring a manual retry.
  • Non-retryable failures (bad request, auth, unknown model, etc.) still fail fast — only 429/5xx/network/timeout responses are retried.

Test plan

  • npx tsc --noEmit — clean
  • npx eslint src/lib/ai/form-prefill-service.ts — clean
  • New unit tests in __tests__/unit/lib/ai-assist-any-form.test.ts: recovers from a single 503 without surfacing an error; still fails with the same friendly message after repeated failures
  • Full npm run test:unit (2634 tests) and full pre-push suite passed locally

🤖 Generated with Claude Code

…iling once

Visitor feedback on /dashboard/projects/create: "Fill with AI" surfaced
"AI service temporarily unavailable" on a single 429/5xx from Groq or
OpenRouter, requiring a manual re-click that "usually works." Retry the
upstream call with the existing withApiRetry backoff utility before
giving up, so a transient hiccup recovers automatically.
@github-actions
github-actions Bot merged commit d9891d4 into main Aug 29, 2026
6 checks passed
@github-actions
github-actions Bot deleted the fix/ai-form-prefill-transient-retry branch August 29, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant