You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model download/load progress is silently swallowed in browser dev mode (bun run dev) #2983
A developer using the default bun run dev browser workflow to test native/local chat models gets a blank, phase-less "loading" overlay for the entire download/verify/load duration whenever a model isn't already loaded (indistinguishable from a hang on a large model), but it always eventually resolves and the shipped Tauri app is completely unaffected. The originally reported "clicking download model" trigger is inaccurate — that Settings button is fully mocked in browser mode (downloadViaMock()) and never reaches this buggy code; the real, reproducing trigger is ensure-model-ready, invoked whenever a chat send needs a model that isn't loaded yet.
Root cause
DownloadModel/EnsureModelReady are server-streaming RPCs emitting ModelLoadProgressEvents. The Tauri path forwards each event live via app.emit. The dev-proxy path (packages/dev-tools/src/dev-proxy.ts:957, and the /ensure-model-ready route) instead calls agentStream(...) (grpc-client.ts:310-320), which buffers every event with stream.on('data', ...) and only resolves on stream.on('end', ...) — the HTTP route then awaits the whole array and discards it, responding 204 with no body. The dev-proxy's only SSE bridge relays WatchNodes node-change events, a completely separate stream; nothing ever surfaces ModelLoadProgressEvent to the browser. The UI's phase-label listener is itself gated behind isTauri(), so browser mode shows only a generic overlay with zero phase/progress info for the whole duration.
Suggested fix
Change agentStream's consumption in /ensure-model-ready to relay each ModelLoadProgressEvent over the existing SSE channel as it arrives, instead of buffering the whole stream and discarding it after await.
Found via the 2026-09-25 full-repo code sweep (finding #37 of 84 in CODE_SWEEP_FINDINGS_2026-09-25.md). Severity: medium. Category: broken.
Activity
malibio commentedon Sep 26, 2026
Frontend baseline: 5406 tests (first run 2 flaky failures, clean on re-run)
Relay model load progress over SSE in browser dev mode (closes #2983)