Dashboard › opencode-lore › Distillation
8d39b023-4f72-4b6b-ba29-d48f2fa765dd["lore_tm_v1_9LPIM6QOPw_n8SgushHy3WkfiTXOsc1mxr_p1nPUiQM","lore_tm_v1__-cmzoNjNgWoRsksMsyV9ahjK4t7Ifbt8Jr4ZIk4xzE","lore_tm_v1_AtXVQcb2QjLLEISp-u4NxscfpSeNJ-mj26qk8gdF_8c","lore_tm_v1_vRqtSpzJMGhPlKBugZmdzl-ZWe1vVf0pdgXS7T_60UE"]
Date: Sep 16, 2026
packages/gateway/src/stream/openai-responses.ts, approximately lines 11712–12335. The code handles principal Responses-stream retry exhaustion ("retry_exhausted"), logs "retrying principal Responses stream after read transport failure", cancels retryResponse.body, clears rollbackPendingPrincipalTerminal, assigns continuation failure categories including "unexpected", calls safeClose(), derives recallFailure, merges usage via mergeUsage(failedResponse.usage, transactionProviderUsage), emits terminal statuses including "response.incomplete" and "failed", aborts with new DOMException("Responses client disconnected", "AbortError"), returns "content-type": "text/event-stream", configures foregroundErrorBodyTimeoutMs from timeoutMs ?? FOREGROUND_ERROR_BODY_TIMEOUT_MS, parses timestamps and bounded retry delays, reads foreground response bodies, strips selected headers, defines an error with message "upstream response did not complete", supports codex = false, parses non-stream envelopes with parseResponsesNonStreamEnvelope(json), and validates protocol values "anthropic" | "openai" | "openai-responses" | "vertex" | "gemini"."recall continuation diagnostics never alter the fixed public failure" in packages/gateway/test/openai-responses-recall-aware-stream.test.ts:9079.packages/gateway/test/openai-responses-stream.test.ts tests fixed failure-envelope replacement for provider events "error" and "response.error" around lines 4274–4332, empty failed projections for buffered provider diagnostics around lines 4374–4407, crossed diagnostic aliases around lines 4481–4518, and rejection of diagnostics before response.created around lines 4528 onward.packages/gateway/test/openai-responses-recall-aware-stream.test.ts: fixed principal failure-envelope replacement around lines 410–453; rejection of non-monotonic source sequences before accepting failure usage around lines 466–505 and 8839–8874; private diagnostic fixtures including "principal-diagnostics-secret", private-${errorEvent}-principal-diagnostic, and "private-recall-failure-diagnostic".packages/gateway/test/foreground-body-limit.test.ts coverage for capped diagnostic bodies, exact-cap reads without probing stalled tails, replacement decoding of malformed or boundary-split UTF-8, and rejection of provider-specific Codex incomplete reasons; packages/gateway/test/gateway-auth-config.test.ts coverage for separate LORE_GATEWAY_AUTH_TOKEN loading and rejection of mixed provider authentication; and packages/gateway/test/gateway-access-auth.e2e.test.ts coverage for uniform pre-work access rejection and acceptance of a gateway token plus exactly one provider-auth mechanism.packages/gateway/test/pipeline-streaming.test.ts:5233: "The third observation promotes only provisionally, and provider failure".