openvibers/openvibe.live Commits

AI: fix the ReferenceError that stopped every VOD overview

OP OpenVibers committed 19 Aug 2026 · 5676e6f2fe · 1 file, +6 −1

_generateVodOverviewInner referenced a variable `stream` that does not exist in
its scope — the parameter is `vod` — so it threw ReferenceError for every
stream-backed VOD with at least two memories, which is the common case. The
rejection propagated to the backfill poller, the VOD was never marked done, and
"[AI backfill] vod: stream is not defined" logged once a minute indefinitely.
That is why ai_overview was null on all nine sessions in
openvibe.media/live/1/transcript.json.

Masked until now because the duplicate-row bug jammed the overview queue on a
single VOD; unjamming it made this fire on every tick.

Co-Authored-By: Claude Opus 5 <[email protected]>

Changes

ddiff --git a/server/ai/ai-analysis.js b/server/ai/ai-analysis.js
iindex d2f91865..b833a857 100644
---- a/server/ai/ai-analysis.js
++++ b/server/ai/ai-analysis.js
@@@ -356,7 +356,12 @@ async function _generateVodOverviewInner(vod) {
const existing = vod.stream_id ? (db.getStreamMemories(vod.stream_id) || []) : [];
if (existing.length >= 2) {
-- const overview = await summarizeStreamMemories(existing, stream && stream.id);
++ // `stream` never existed in this scope — the parameter is `vod` — so this threw
++ // ReferenceError for every stream-backed VOD with >=2 memories, i.e. the common
++ // case. generateVodOverview() rejected, the VOD was never marked done, and the
++ // backfill logged "[AI backfill] vod: stream is not defined" once a minute
++ // forever. That is why ai_overview was null on every recent VOD.
++ const overview = await summarizeStreamMemories(existing, vod.stream_id || null);
if (overview) { try { db.setVodAiOverview(vod.id, overview); } catch { /* */ } }
return overview;
}