free-coding-models icon indicating copy to clipboard operation
free-coding-models copied to clipboard

Docker: web dashboard loads but never refreshes model stats

Open lehneres opened this issue 4 months ago • 2 comments

with a little help from my friend...

Bug description

Running the official Docker image, the web dashboard at http://localhost:19280/ loads the initial model table but latency, status, verdict, and health cells stay frozen at their initial state. They never update regardless of how long you wait.

Steps to reproduce

  1. Run the official Docker image (same if run from local build):
    docker run -p 19280:19280 ghcr.io/vava-nessa/free-coding-models:latest
    
  2. Open http://localhost:19280/ in Chrome
  3. Open DevTools → Console and Network tabs
  4. Observe in Console:
    WebSocket connection to 'ws://localhost:19280/socket.io/?
    EIO=4&transport=websocket' failed: Error during WebSocket
    handshake: Unexpected response code: 404
    
  5. Observe in Network tab:
    • GET /socket.io/?EIO=4&transport=polling → 404 (HTTP fallback after WS fails)
    • GET /api/events → 200 (SSE fallback connects successfully)
    • The SSE stream sends exactly one payload on connect, then nothing
  6. Watch the model table — all cells show pending / — indefinitely

Evidence

1. WebSocket handshake fails with 404

The React app tries to connect via Socket.IO WebSocket transport to ws://localhost:19280/socket.io/. The daemon has no Socket.IO support and returns 404. The same happens for the HTTP polling fallback (GET /socket.io/ → 404).

2. SSE fallback connects but receives no updates

GET /api/events returns 200 and delivers the initial state payload, but after that the stream is silent. Verified with curl:

: connected

data: {"pingMode":"normal","pingModeSource":"daemon-probe-mode",...}
                                                                    ← nothing for 10+ seconds

The connection stays open (no onerror), so the frontend's REST polling safety net (2s interval, triggered only when no update arrives for 4s) never activates either.

3. Code: recordProbeResult never broadcasts full model state

src/core/router-daemon.js:1091 — after each probe result, the daemon broadcasts a lightweight probe event:

this.broadcast('probe', {
  model: key,
  status: result.ok ? 'ok' : 'fail',
  latency_ms: result.latencyMs ?? null,
  ...
})

The frontend (web/src/hooks/useSocket.js) does not listen for probe events — it only handles models SSE events (via es.addEventListener('models', ...)).

The daemon has a broadcastWebState() method (router-daemon.js:1414) that sends the full models payload (same shape as GET /api/state). It is called only in 5 locations inside benchmark code (runWebBenchmark / runGlobalBenchmark), never from the probe pipeline.

Compare with web/server.js where broadcastUpdate() is called after every ping (18+ call sites across the file), which emits both Socket.IO models:update and SSE models events.

4. Daemon is probing — results are stored but not broadcast

Daemon logs confirm the probe loop is active (autoHeal runs, models are marked AUTH_ERROR, etc.), but no event: models SSE frames are ever emitted.

Impact

  • Model latency, status, verdict, uptime, health never update
  • The dashboard appears functional on first load but is a static snapshot
  • Users who configure API keys also see no updates — probes complete internally but frontend never receives the results
  • The bug is invisible to casual users (no JS console errors), so it goes unreported

Console output (Chrome)

Only error:

WebSocket connection to 'ws://localhost:19280/socket.io/?
EIO=4&transport=websocket' failed: Error during WebSocket
handshake: Unexpected response code: 404

One harmless exception (PostHog placeholder key, unrelated):

TypeError: n is not a function
  at http://localhost:19280/:58:459

No further errors — the SSE fallback connects silently but stays idle.

Environment

  • Docker image: ghcr.io/vava-nessa/free-coding-models:latest (v0.5.65)
  • macOS, Chrome 150

Related

Same class of issue as #116: API routes that exist in web/server.js are missing or incomplete in router-daemon.js, causing Docker-mode dashboard features to silently break.

lehneres avatar Jul 29 '26 16:07 lehneres

honestly not sure about this one, feels like this wouldn't work for anyone but I don't see related issues open currently. Keen to understand if anyone else sees the same issue

lehneres avatar Jul 29 '26 16:07 lehneres

Fixed and shipped in v0.5.73 — great report, your diagnosis was spot on. 🙏

You were right: the daemon only broadcast a lightweight probe event after each ping, but the web dashboard only listens for full models events — so stats were computed and stored but never pushed to the browser. recordProbeResult now triggers a debounced full-state broadcast (one per 250ms window during probe bursts), so latency/status/verdict/health update live again.

Grab it with docker pull ghcr.io/vava-nessa/free-coding-models:latest (or npm i -g free-coding-models) and let me know if the table is still frozen.

vava-nessa avatar Aug 15 '26 11:08 vava-nessa