Planning Mode now automatically retries a stuck or terminally-errored AI
generation session up to three times before falling back to the permanent
Retry/Dismiss error panel, reducing manual retries for transient failures.
- Add a bounded (MAX_PLANNING_AUTO_RETRIES = 3) client-side auto-retry that
reuses the existing /planning/:id/retry endpoint whenever the SSE stream's
onError, a session reload, or the stuck-session poll observes a terminal
"error" status.
- Track the retry budget in refs (planningAutoRetryAttemptRef,
planningAutoRetryInFlightRef) so async SSE/poll/loadSession handlers share
a single in-flight guard, with the current attempt mirrored into state
(isAutoRetrying/autoRetryAttempt) for the UI.
- Reset the retry budget whenever the session makes real progress (reaches
a new question or a completed summary), and surface the permanent
Retry/Dismiss error view once the budget is exhausted.
- Show a "Retrying... (attempt N of 3)" loading message while an automatic
retry is in flight, distinct from the manual Retry button state.
- Fix a stuck-poll edge case where a terminal error discovered only by the
poll (missed SSE event) after the auto-retry budget was exhausted left
the modal spinning on "Generating next question..." forever instead of
showing the error view.
- Document the new auto-retry behavior in docs/dashboard-guide.md and add a
minor changeset for @runfusion/fusion.
- Extend PlanningModeModal.planning-flow.test.tsx with coverage for the
auto-retry budget, single-flight behavior, and the poll-discovered
terminal-error fallback.
Files changed:
.changeset/fn-7946-planning-auto-retry.md | 7 +
docs/dashboard-guide.md | 3 +
.../dashboard/app/components/PlanningModeModal.tsx | 339 ++++++++++++++------
.../PlanningModeModal.planning-flow.test.tsx | 353 ++++++++++++++++++---
4 files changed, 567 insertions(+), 135 deletions(-)
Fusion-Task-Id: FN-7946
Fusion-Task-Lineage: 42e911dc-9639-46ab-bb4f-bc9060413140
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>