MicroFish/backend
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
..
app feat(report): allow resuming report generation after failure 2026-04-18 16:48:58 +03:00
scripts Add UTF-8 encoding support for Windows in simulation_runner.py and run_parallel_simulation.py to resolve character encoding issues with third-party libraries. 2025-12-26 18:14:57 +08:00
pyproject.toml fix(file_parser): handle non-UTF-8 encoded text files with automatic encoding detection 2026-01-22 18:28:37 +08:00
requirements.txt fix(file_parser): handle non-UTF-8 encoded text files with automatic encoding detection 2026-01-22 18:28:37 +08:00
run.py Add UTF-8 encoding support for Windows console in run.py and logger.py to prevent character encoding issues 2025-12-26 17:58:48 +08:00
uv.lock fix(file_parser): handle non-UTF-8 encoded text files with automatic encoding detection 2026-01-22 18:28:37 +08:00