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.
This commit is contained in:
Martin Dvořák 2026-10-13 18:06:25 +00:00
commit 20bb08b0e7
8 changed files with 125 additions and 19 deletions

View file

@ -1411,6 +1411,15 @@ Things I chose while building, with the reasoning:
pre-blurred wallpaper — the scene is clearly visible through the glass, and the
pixel-contrast scan still passes.
75. **A quiet run can no longer load forever.** 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 — verified with a stalled
route and Playwright's fake clock in the wizard suite (93 checks). The heartbeat also keeps
proxies from closing an idle connection.
74. **Phones get flat glass, not live blur.** The touch fallback from 73 (a real backdrop blur
over the live scene) turned out to be the wrong trade: every pane re-blurs on every frame
while the bubbles animate, and phones choke — input lag, "buttons take ages to respond". Touch