freezmo/app/api
Martin Dvorak 20bb08b0e7 Infinite loading guard: heartbeats + stall watchdogs on the model runs
A user got stuck on the wizard's loading screen: a hung model meant
silence, and silence was indistinguishable from work - the server's own
hard deadline is 2x OLLAMA_TIMEOUT_MS (ten minutes by default), and the
client waited on a dead stream indefinitely.

Both generate routes (deck, homework) now send an NDJSON heartbeat
every 15s, and the client guards the two quiet phases: no response at
all for 45s, and no bytes for 90s mid-stream, both surfacing the
regular error state with a Retry. The caller's abort still maps to the
friendly "cancelled" state.

Verified with a stalled route and Playwright's fake clock in the wizard
suite (93 checks), plus contrast 0 findings, mobile 124/124, chat
101/101, regression 44/44, i18n 13/13, native 33/33.
Version 0.4.0, SW -> freezmo-v69.
2026-10-13 18:06:25 +00:00
..
chat Security: model budget + concurrency caps, SSRF guards, spoof-proof limits 2026-10-12 20:40:57 +00:00
generate Infinite loading guard: heartbeats + stall watchdogs on the model runs 2026-10-13 18:06:25 +00:00
grade Security: model budget + concurrency caps, SSRF guards, spoof-proof limits 2026-10-12 20:40:57 +00:00
health Chat mode, phase 1: grounded streaming chat over your notes 2026-10-11 18:32:11 +00:00
healthz App versioning + the create page's missing top padding 2026-10-12 20:04:26 +00:00
homework Infinite loading guard: heartbeats + stall watchdogs on the model runs 2026-10-13 18:06:25 +00:00
push Security: model budget + concurrency caps, SSRF guards, spoof-proof limits 2026-10-12 20:40:57 +00:00
reports Security: model budget + concurrency caps, SSRF guards, spoof-proof limits 2026-10-12 20:40:57 +00:00
sync Phase 1: backup, encrypted sync and monthly-usage handling 2026-10-10 13:43:42 +00:00