Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs([issue-1334]): log videoGen close-handler fix to changelog

[._.]/ Adam Eivyd787799060d7
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 66df8201bd..fbafeeeb77 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -40,6 +40,8 @@
## Fixed
+- **A late failure while finishing a local video render now fails the job cleanly instead of crashing the server (or leaving the job stuck "running").** When a render's child process exited and the final bookkeeping step (saving the clip to history, writing its thumbnail) threw, the error escaped the process-close handler as an unhandled rejection — which on modern Node can take down the whole server, and in any case left the media job wedged at "running" forever with no error ever reaching the UI. Both of `videoGen`'s child-close handlers (the main render finalizer and the last-frame extractor used by chained/extend renders) now catch such failures and surface them as a normal terminal error on the job, so the render is reported as failed and the next one proceeds. This path is newly exercised by LoRA-fused renders. (`server/services/videoGen/local.js`, #1334)
+
- **The comic-panel and storyboard "AI: refine" image-prompt buttons no longer throw "Stage not found" on pm2-restart-only upgrades.** Both stage prompts (`pipeline-comic-panel-image-prompt`, `pipeline-storyboard-image-prompt`) ship in `data.reference/` and are wired to the comic-panel / storyboard image-prompt refine buttons, but they were added without a seed migration. Boot runs migrations but **not** `setup-data.js`, so an install that upgraded by pulling + `pm2 restart` (instead of running `update.sh`) never received them — `buildPrompt('pipeline-comic-panel-image-prompt')` then threw "Stage not found" the first time the user clicked "AI: refine." A new first-shipment seed migration (mirrors 090) copies each `.md` into `data/prompts/stages/` and merges its `stage-config.json` entry, only when missing — never clobbering a customized install. (`scripts/migrations/091-seed-image-prompt-stages.js`)
- **Imported ChatGPT conversations now sort by their original recency in the Brain ▸ Memory list, instead of arbitrary export order.** A ChatGPT export isn't ordered chronologically, and a bulk import stamps every entry's `createdAt`/`updatedAt` with the same import time — so the memory list (which returned records in insertion order and showed "Updated {import time}" on every card) left imports jumbled and indistinguishable. The importer now persists **both** source clocks (`sourceCreatedAt` *and* the previously-dropped `sourceUpdatedAt`, the conversation's last-activity time), `getMemoryEntries()` orders entries newest-first by an effective recency timestamp (`memoryRecencyMs`: prefers the source clock for imports, falls back to the storage clock for hand-written notes), and the card footer shows "Conversation {N ago}" using the source date for imported entries (matching the sort) rather than the misleading bulk-import time. Existing imports (which already carry `sourceCreatedAt`) sort correctly without a migration. The memory create/update Zod schema (`memoryInputSchema`) gains the provenance fields (`source`, `sourceRef`, `sourceCreatedAt`, `sourceUpdatedAt`) for schema parity with what `createMemoryEntry` persists. (`server/services/brainStorage.js`, `server/services/chatgptImport.js`, `server/lib/brainValidation.js`, `client/src/components/brain/tabs/MemoryTab.jsx`)