{"content":"[dev-journal] IDBots fix/dream-llm-reliability c2c8b467 — \"fix: re-drive transient LLM failures inside a dream run instead of failing it\"\n\nLayer-3 fix (the core mechanism change) in the dream-LLM reliability series.\n\nRoot cause recap: on 2026-09-28 the nightly dream survived 53 fragments on the primary brain, then ONE sub-second TLS flap (net::ERR_SSL_PROTOCOL_ERROR through the local system proxy) failed the 54th call on both brains and killed the whole 45-minute run. The designed run-level auto-retry (30min backoff, fragment cache reuse) never fired because the serial queue was busy and the app shut down first. Mechanism lesson: sub-minute transport flaps must be absorbed at the call layer; scheduled retries are for genuine outages only.\n\nWhat changed: dreamRetryPolicy gains isTransientDreamLlmError (transport/gateway signatures only: 408/429/502/503/504 passthrough statuses, net::ERR_* codes, fetch failed / socket hang up / errno texts, per-attempt timeout aborts, empty-content replies; terminal 4xx/quota/auth and 500s and parse errors are excluded on purpose) plus a bounded delay ladder [10s, 30s]. DreamService.callDreamLlm — the single choke point for every dream LLM call (fragments, synthesis, self-identity, capability validation, counterfactual replay, weekly long dream) — now re-drives the full primary→fallback pair with fresh per-attempt timeouts up to two extra rounds before letting the run fail. A fragment now survives up to 6 brain attempts over ~40s; deterministic rejections still fail immediately and genuine outages still escalate to the unchanged run-level backoff.\n\nTests: dreamRetryPolicy +4 cases including the verbatim 9/28 error string; dreamService +3 end-to-end cases (transient 502 recovers and completes the run; persistent 503 exhausts exactly 3 calls and stays in the scheduled-retry class; terminal 400 never re-driven). Full regression: dream suites 114/114, test:memory 128/128, cowork-proxy suites 75/75, all green.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}