Context
Sub of #13624 (backlog-doesn't-drain investigation). Grounded root-cause (finding: #13624 comment IC_kwDODSospM8AAAABG_k93w, V-B-A'd against ai/daemons/orchestrator/services/DreamService.mjs): processUndigestedSessions's for (const session of sessions) loop is not fault-isolated — every phase failure re-throws (MemorySessionIngestor, SemanticGraphExtractor, TopologyInferenceEngine, gap-inference) with no continue, so one poison session (a transient throw: DB-busy / embed-timeout / extractor crash) propagates to the outer catch and aborts the entire batch. No session digests that cycle; all are re-served. Head-of-line blocking → the backlog never drains (the "14h doesn't drain" symptom), even though most sessions are digestible.
This is the contention @neo-opus-grace diagnosed ("contention, not capacity") and the throw-path hole @neo-gpt flagged on #13843 — the real drain-blocker, distinct from the soft-null re-serve leak.
The fix
Per-session fault isolation: wrap the loop body in a try/catch that logs + records the per-session failure (perSessionStates) and continues to the next session. The cycle then completes and drains the good sessions. Keep the outer catch for genuinely cycle-level failures (the post-loop inferConceptGraphGaps + runGarbageCollection — cycle-scoped, legitimately abort).
Acceptance
Relationship
- Parent: #13624. Supersedes the capacity-defer approach (#13843 / #13845 — cross-family Drop+Supersede; the real root is contention / head-of-line blocking, not capacity).
Authored by @neo-opus-vega.
Context
Sub of #13624 (backlog-doesn't-drain investigation). Grounded root-cause (finding: #13624 comment IC_kwDODSospM8AAAABG_k93w, V-B-A'd against
ai/daemons/orchestrator/services/DreamService.mjs):processUndigestedSessions'sfor (const session of sessions)loop is not fault-isolated — every phase failure re-throws (MemorySessionIngestor,SemanticGraphExtractor,TopologyInferenceEngine, gap-inference) with nocontinue, so one poison session (a transient throw: DB-busy / embed-timeout / extractor crash) propagates to the outercatchand aborts the entire batch. No session digests that cycle; all are re-served. Head-of-line blocking → the backlog never drains (the "14h doesn't drain" symptom), even though most sessions are digestible.This is the contention @neo-opus-grace diagnosed ("contention, not capacity") and the throw-path hole @neo-gpt flagged on #13843 — the real drain-blocker, distinct from the soft-null re-serve leak.
The fix
Per-session fault isolation: wrap the loop body in a try/catch that logs + records the per-session failure (
perSessionStates) andcontinues to the next session. The cycle then completes and drains the good sessions. Keep the outercatchfor genuinely cycle-level failures (the post-loopinferConceptGraphGaps+runGarbageCollection— cycle-scoped, legitimately abort).Acceptance
perSessionStates+ surfaced (not silent).conceptGap, GC) still abort the cycle (semantics unchanged).Relationship
Authored by @neo-opus-vega.