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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (codex): ensureDir(PATHS.videos) before first video download
[._.]/ Adam Eivyaa6fa8ae6d9f
diff --git a/.changelog/v2.25.0.md b/.changelog/v2.25.0.mdindex ed5fe8edb8..0c2585c55a 100644--- a/.changelog/v2.25.0.md+++ b/.changelog/v2.25.0.md@@ -130,6 +130,7 @@ Released: 2026-07-01## Fixed+- **Video download now works on a fresh install** — `startVideoDownload` pointed yt-dlp at `data/videos` without ensuring the directory exists, so on a fresh install (where no prior render/import had created it) the very first download failed before producing a file. It now `ensureDir`s the target first, like every other video writer. (`server/services/videoDownload.js`)- **Chief of Staff and Moltworld live updates now survive a socket reconnect** — the server rebuilds an empty per-socket subscriber Set on every reconnect (laptop sleep, network blip, server restart), but both consumers registered their re-subscribe only conditionally: `ChiefOfStaff` attached its `socket.on('connect', …)` handler solely in the else branch (skipped when the socket singleton was already connected at mount) and `useMoltworldWs` emitted `agents:subscribe` once at mount with no connect listener at all. So after a reconnect the `cos:*` / `moltworld:*` events went dead until the component remounted — and the Moltworld feed has no polling fallback. Both now subscribe immediately when connected *and* re-subscribe on every `connect`, matching the established `Shell.jsx` pattern. (`client/src/pages/ChiefOfStaff.jsx`, `client/src/hooks/useMoltworldWs.js`)- **Beat-snapping a right-edge timeline drag no longer commits a scene shorter than the minimum** — `computeDragSpan` floored the out-point at `startSec + minSceneSec` before snapping to the beat grid, then overwrote it with the snap target unconditionally, so a beat sitting just below the floored end (within tolerance) could commit a span under the minimum scene length. The floor is now re-applied after the snap. Server-side `beatSnapClips` re-clamps at render, so this was a displayed/committed-span bug only; covered by a new regression test. (`client/src/lib/beatGrid.js`)- **[issue-2022] Moltworld presence panel no longer shows phantom agents after everyone leaves** — `useMoltworldWs`'s `handlePresence`/`handleNearby` gated the state write on `agents.length > 0`, so an empty "nobody nearby" snapshot (forwarded verbatim from the external Moltworld WS) was silently dropped and the WorldTab "Nearby Agents" panel stuck on a stale agent list forever. Both handlers now validate `Array.isArray(agents)` and call `setPresence` unconditionally for a well-formed array, so a confirmed-empty event clears the panel. `presence` initializes to `null` (not-yet-known) rather than `[]`, and `WorldTab` distinguishes the two: `null` falls back to the last REST join/explore list, while an empty array is a live "nobody here" snapshot that wins over the stale fallback. A malformed non-array payload preserves prior state. Covered by new hook tests. (`client/src/hooks/useMoltworldWs.js`, `client/src/components/agents/tabs/WorldTab.jsx`, Closes #2022)diff --git a/server/services/videoDownload.js b/server/services/videoDownload.jsindex 4582e5591e..425acbe3fa 100644--- a/server/services/videoDownload.js+++ b/server/services/videoDownload.js@@ -21,7 +21,7 @@ import { readdir, unlink } from 'fs/promises';import { join, dirname } from 'path';import { randomUUID } from 'crypto';import { ServerError } from '../lib/errorHandler.js';-import { shortId, PATHS } from '../lib/fileUtils.js';+import { shortId, PATHS, ensureDir } from '../lib/fileUtils.js';import { findFfmpeg, generateThumbnail, probeVideoDuration } from '../lib/ffmpeg.js';import { findYtDlp } from '../lib/ytdlp.js';import { broadcastSse, attachSseClient as attachSse, closeJobAfterDelay } from '../lib/sseUtils.js';@@ -178,6 +178,11 @@ export async function startVideoDownload(url) {(async () => {let title = '';try {+ // On a fresh install data/videos may not exist yet (setup-data.js doesn't+ // create it, and no prior render/import may have). Every other video+ // writer ensures it first; without this the first download points yt-dlp+ // at a missing directory and fails before producing a file.+ await ensureDir(PATHS.videos);const args = [// Prefer an mp4 (h264/aac) video+audio pair that merges cleanly for// broad browser playback; fall back to best single-file mp4, then best.