MicroFish/backend/app
andreicarpen 0387dc7210 feat(report): allow resuming report generation after failure
When report generation in Step 4 fails mid-way (e.g. AI credits exhausted,
network error), users previously had to restart from scratch, losing the
outline and any already-completed sections.

This change preserves partial progress and lets users continue from where
generation stopped:

- Backend: `generate_report(resume=True)` reloads the saved outline and
  per-section markdown files, skips the planning phase, and only generates
  the missing sections. The `/api/report/generate` endpoint accepts a
  `resume` flag and reuses the failed report's `report_id`.
- Frontend: Step4Report polls `/progress` and, when `status === 'failed'`,
  shows a "Resume Generation" banner with the failure message and a button
  that calls `generateReport({ simulation_id, resume: true })` and
  restarts log polling.
- Adds `resumeStart` / `sectionResumed` / `reportFailedTitle` /
  `resumeGeneration` locale keys in en and zh.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 16:48:58 +03:00
..
api feat(report): allow resuming report generation after failure 2026-04-18 16:48:58 +03:00
models feat(i18n): replace hardcoded Chinese in backend SSE progress messages 2026-04-01 16:32:10 +08:00
services feat(report): allow resuming report generation after failure 2026-04-18 16:48:58 +03:00
utils fix(i18n): validate Accept-Language header against registered locales 2026-04-02 14:20:15 +08:00
__init__.py Implement Report Agent for automated report generation and interaction 2025-12-09 15:10:55 +08:00
config.py fix(config): enable overriding of environment variables when loading .env file 2026-01-23 16:20:24 +08:00