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

keep every await inside the ingest coordinator's try

[._.]/ Adam Eivyda8d2baafd4f
diff --git a/server/services/youtubeIngest.js b/server/services/youtubeIngest.js
index ae8976a95b..7e8d34ce2c 100644
--- a/server/services/youtubeIngest.js
+++ b/server/services/youtubeIngest.js
@@ -559,15 +559,18 @@ export async function startYoutubeIngest({
// event's `happenedAt` can't disagree — an ingest that downloads a 3-hour
// video legitimately crosses midnight.
const capturedAt = new Date().toISOString();
- // Read once: the vault/folder decision and the CoS task priority both come
- // from here, and an ingest should use one settings snapshot throughout.
- const settings = await getSettings();
// A dedicated per-job temp dir rather than a shared-prefix scan of
// os.tmpdir() (which routinely holds thousands of entries on macOS): the
// captions are found with a 2-entry readdir and removed with one rm.
const subsDir = captureTranscript ? join(tmpdir(), `portos-yt-subs-${jobId}`) : null;
+ // Every await in this fire-and-forget coordinator must sit INSIDE the try:
+ // there is no request lifecycle to bubble to, so a rejection escaping it
+ // takes the whole Node process down (root CLAUDE.md, no-try/catch exception).
try {
+ // Read once: the vault/folder decision and the CoS task priority both come
+ // from here, and an ingest should use one settings snapshot throughout.
+ const settings = await getSettings();
await ensureDir(INGEST_DIR);
if (subsDir) await ensureDir(subsDir);