diff --git a/static/js/chat.js b/static/js/chat.js index 1aae61fcf..62763cabd 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -6149,9 +6149,12 @@ import { invalidateSettings } from './appConfig.js'; cache: 'no-store', }); if (!_getForegroundStreamState() || _backgroundStreams.has(sid)) return; + // 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 (_) { /* An invalid response is not an idle stream. */ } + try { _probe = await res.json(); } catch (_) { _probe = null; } const _noActiveStream = res.status === 404 || (res.ok && _probe && typeof _probe.status === 'string' && _probe.status !== 'streaming'); if (!_noActiveStream) return;