Dashboard › opencode-lore › Distillation
fd7a53f0-63f2-45c0-89df-05d338964c26["lore_tm_v1_3dPjcMF6618F8o2b3zmomPClSDNUG5WABDRtyho6UTo","lore_tm_v1_fZZHf2fkLzaelvnVsXYA6s_eBztr_HW1NjossIggWYQ","lore_tm_v1_SVSEylZVPdYZzvDsrfG5zz0LFm0yxXu-HnCOIcWbevU","lore_tm_v1_S8e1QgYiOs94ybMbjhm-4DDmzt6y-sLqBgDOozIBGWc","lore_tm_v1_Ot0cPGnZ2-Ja4hv0hPjm4FKcUx5d-E5DTGmLXXWyGYo","lore_tm_v1_R2kBd9MPK1kTwgI7PYn_Y06vy273TLUwlKGCcmtop5M","lore_tm_v1_fENdtGPrwj98holc86wLi5_aXieWjcpSLKeq0RRkmUs"]
Date: Sep 16, 2026
stream flag must never diverge from how the continuation is consumed.packages/gateway/src/pipeline.ts, non-stream recall couples build, forward, content-type assertion, and parsing: Codex uses runRecallFollowUpStreamAccumulated() because /backend-api/codex/responses mandates streaming and rejects stream: false with 400 {"detail":"Stream must be set to true"}; other backends use runRecallFollowUpJSON() with stream:false.makeJSONRecallCtx() parses JSON through accumulateNonStreamResponse() and parses SSE through accumulateResponsesSSEStream() with stopAtTerminal: true, requireCompletedTerminal: true, validation set to "codex" or "public", and requireSuccessfulCompletion: recovery.recoverRecallContinuation() calls runRecallRecovery(), merges usage and ordered codexRateLimits, rejects recovered output containing another recall tool or lacking a usable continuation, and returns failRecall(category, false) for non-abort recovery failures. AbortError and foregroundAbort.signal.aborted are rethrown.mergeFailedContinuationMetadata() preserves usage and codexRateLimits from ResponsesTerminalError and NonStreamCompletionError; failed normal follow-ups attempt recovery under "follow_up_failed", while recall on the final round or after a budget stop recovers under "depth_exhausted".appendCodexRateLimitEvent(), then attached to continuationResp, recovered continuations, and the final currentResp, allowing newer quota-window updates to follow older ones.packages/gateway/src/pipeline.ts checks isEmptyCompletion(currentResp) and records protocol, model, sessionID, stopReason, outputTokens, and recallDepth through captureEmptyCompletion(); it also logs an empty completion β client warning.coverage is private and must never be emitted to the client.packages/gateway/src/pipeline.ts includes private coverage?: readonly import("@loreai/core").RecallCoverage[], alongside anchorText, resultText, and optional commit()/rollback() transaction hooks.postResponse.packages/gateway/src/pipeline.ts, streaming Responses events are normalized with normalizeCodexEvent(), lifecycle-validated by validateResponseLifecycle(), seeded through seedImplicitCodexItem(), and then accumulated via applyResponsesEvent() even when recall-related events will be hidden from the client.parsedRecallInputs, pendingRecalls, and recallIndices; unresolved sparse Codex function-call identities use unresolvedToolIndices and unresolvedToolBytes, while non-recall function calls set otherToolSeen.SSEStreamLimitError with exact messages including Responses stream exceeded byte limit, Responses retained state exceeded byte limit, and recall stream exceeded deferred event limit.applyResponsesEvent() may return an accepted codex.rate_limits record; appendCodexRateLimitEvent(publicCodexRateLimits, acceptedCodexRateLimit) determines the public quota event, while internal accumulation occurs regardless. The public event is reserialized through JSON.stringify(publicCodexRateLimit).[DONE]; malformed JSON in an event whose name starts with response. throws malformed JSON in Responses event ${event}, mismatched payload types throw Responses payload type does not match ${event}, and non-JSON non-message events are forwarded or deferred depending on active recall/unresolved-tool state.