Repository navigation
fix(onboarding): retry LLM suggestion calls and fall back to manual entry - #443
Merged
Merged
Conversation
…ntry Closes #379. Supersedes the stalled #385. Server: the shared withRetry helper moves from lib/audit to lib/retry (audit imports updated) and now wraps every onboarding LLM call with 3 attempts + exponential backoff: topics /suggest and competitors /suggest wrap their WHOLE two-phase flow (research + structuring), so a Phase-2 schema miss like competitors' .min(3) under-count re-runs the research too; prompts /suggest AND /from-topics — the generator the onboarding prompts step actually uses, which the previous attempt missed — get the same treatment. Input-validation 400s still return before any LLM call and are never retried. Web: when suggestions fail after the server exhausts its retries, the bare error toasts are replaced with inline fallbacks that keep the manual path usable. Topics and competitors steps show an amber 'add your own below' notice with a Try again button; a prompts-step failure no longer strands the user on the topics step — they advance with empty per-topic groups, an inline notice, and the existing per-topic add inputs (Continue stays disabled until at least one prompt exists).
This was referenced Jul 16, 2026
gkhngyk
added a commit
that referenced
this pull request
Jul 17, 2026
…duplicating brands (#467) The Add-a-new-brand flow had no recovery path when topic suggestion failed: a transient toast, an empty suggestion list, and a disabled continue button left the user stranded on step 3. Worse, the natural retry — Back to step 2, Continue again — called createBrand unconditionally and inserted a duplicate brand on every round-trip. - Topic and competitor suggestion failures now show the onboarding-style amber inline banner with a Try again button (#443 pattern) plus copy pointing at the manual input as the fallback, replacing the toasts. - handleCreateBrand is idempotent: once createdBrand exists, re-submitting step 2 updates the brand in place (updateBrand, extended with region/language) and syncs the domain row only when the website actually changed (syncDomains), then advances. The brand store is updated so the switcher reflects edits immediately. Step gating is unchanged: no advancing past step 3 with 0 topics or past step 4 with 0 prompts. Closes #447
7 tasks done
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
Closes #379. Supersedes the stalled #385 (closed).
Server — bounded retry on every onboarding LLM call. The
withRetryhelper is promoted fromlib/audit/retry.jstoserver/src/lib/retry.js(audit imports updated, log label generalized) and now wraps all four suggestion generators with 3 attempts + exponential backoff:topics /suggestandcompetitors /suggestwrap their whole two-phase flow (search-grounded research → structuring), so a Phase-2 schema miss — e.g. the competitors schema's.min(3)under-count throwingNoObjectGeneratedError— re-runs the research too, giving the structuring phase fresh material.prompts /suggestandprompts /from-topics— the generator the onboarding prompts step actually calls, which the previous attempt missed.400s return before any LLM call and are never retried.Web — graceful fallback when retries are exhausted. Bare error toasts are replaced with inline notices that keep the manual path usable:
Related Issue
Closes #379
Type of Change
How to Test
TOPIC_SUGGESTION_MODELat an invalid model for one attempt, or drop the network briefly) → the step succeeds on a later attempt; server logs[retry] topic-suggest attempt 1/3 failed; retrying.cd server && npm test(115) andcd web && npm test(45) pass.Checklist
npx tsc --noEmitpasses