From 76ab72412deaf1126f81c2b5855dcfd96ccba83a Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Mon, 26 Oct 2026 16:34:56 +0000 Subject: [PATCH] Preserve completion gating and handle explicit idle stream status safely --- static/js/chat.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/chat.js b/static/js/chat.js index 38243ca1b..4c08cd8cc 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -6213,9 +6213,11 @@ import { invalidateSettings } from './appConfig.js'; // The server now reports "no active stream" as 200 {status:"idle"} (an // older server used 404); a body with status "streaming" means it is NOT // stale. Accept both so the watchdog keeps working across deploys. + if (res.status !== 404 && !res.ok) return; let _probe = null; try { _probe = await res.json(); } catch (_) { _probe = null; } - const _noActiveStream = res.status === 404 || !_probe || _probe.status !== 'streaming'; + const _noActiveStream = res.status === 404 || (res.ok && _probe && + typeof _probe.status === 'string' && _probe.status !== 'streaming'); if (!_noActiveStream) return; console.warn('[stream-watchdog] Local stream was stale and server has no active stream. Unlocking composer.');