Skip to content

Model download/load progress is silently swallowed in browser dev mode (bun run dev) #2983

Closed

Description

@mstomar125

Problem

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

  1. added
    sweepFound via the 2026-09-25 full-repo code sweep
    on Sep 25, 2026
  2. malibio commented on Sep 26, 2026

    @malibio
    Collaborator

    Frontend baseline: 5406 tests (first run 2 flaky failures, clean on re-run)

  3. self-assigned this
    on Sep 26, 2026
  4. added a commit that references this issue on Sep 26, 2026
    a221e63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

sweepFound via the 2026-09-25 full-repo code sweep

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions