Dashboard › opencode-lore › Distillation
e20d1be4-3a89-439a-b1a8-c6427e3c96f7["lore_tm_v1_hdia_IvdgGnNXcXSFB7VF--uHZcQ8oTgeowYJHLHYPI"]
Date: Sep 16, 2026
packages/gateway/src/pipeline.ts:10351-10362, response.output_item.done calls collectCompletedRecall(state, outputIndex, parsedRecallInputs, pendingRecalls) for recall events, and all recall-item or unresolved-tool events are withheld from the client via continue.packages/gateway/src/pipeline.ts:10365-10430, terminal handling covers response.completed, response.done, response.incomplete, and response.failed; it sets principalReadFinished = true, removes hidden reference output with stripHiddenReferenceOutput(parsed), detects function_call items named RECALL_TOOL_NAME, validates terminal output through assertTerminalOutputMatches(...), and then requires complete output lifecycles through assertOutputLifecyclesComplete(state).packages/gateway/src/pipeline.ts:10391-10425, terminal reconciliation can promote a sparse unresolved tool identity into a recall: it sets recallDetected, adds the output index to recallIndices, removes it from unresolvedToolIndices, calls discardDeferredCandidate(outputIndex) and promoteDeferredCandidate(outputIndex), and later either collects a completed recall or marks a non-recall function call by clearing unresolved tracking and setting otherToolSeen = true.packages/gateway/src/pipeline.ts:10431-10435, terminal processing requires assertReferenceLifecyclesComplete(referenceIndices) and assertRecallItemsCompleted(state, pendingRecalls.map((recall) => recall.outputIndex)).packages/gateway/src/pipeline.ts:10436-10446, a successful terminal after one or more principal transport retries reports { kind: "read", stage: "pre_output", outcome: "retry_succeeded" } exactly once through reportPrincipalTransportFailure(...), guarded by principalRetrySucceededReported.packages/gateway/src/pipeline.ts:10447-10491, unresolved sparse function identity throws "Responses terminal left sparse function identity unresolved" and incomplete recall arguments throw "recall stream ended before function arguments completed"; otherwise deferred events are replayed through enqueuePrincipal(deferred.chunk, otherToolSeen), deferred storage is cleared, the sanitized terminal event is forwarded, terminalDelivered is set in the delivery callback, finish(...) is invoked, the reader is canceled/released, keepalive is cleared, and the stream closes.packages/gateway/src/pipeline.ts:10493-10505, recall execution rejects a principal terminal of response.failed with "recall principal returned response.failed", rejects response.incomplete with "incomplete recall principal cannot execute recall", and rejects more than one pending recall with new RecallContinuationFailure("parallel_recall").packages/gateway/src/pipeline.ts:10506-10518, beginning the recall loop snapshots transactionBaseline from state, including cloned usage, items, and rawItems; resets transactionProviderUsage to { ...ZERO_USAGE }; and charges the principal stream once to the shared request budget with recallBudget.recordUsage(state.usage) before admitting its first recall.packages/gateway/src/pipeline.ts:10518-10530, recall continuation output is transactional: commits are held in pendingCommits, encoded chunks in transactionalEvents, and reserveTransactionalBytes(chunk) increments transactionalBytes and throws new RecallContinuationFailure("resource_limit") when it exceeds maxTransactionalBytes.packages/gateway/src/pipeline.ts:10531-10541, each pending recall reserves synthetic identity msg_${state.id || "lore"}_${recall.outputIndex}, finalizes the current response accumulator, searches its content for the matching tool_use block by recall.toolUseId, and throws new RecallContinuationFailure("missing_recall_block") if no matching block exists.packages/gateway/src/pipeline.ts:10542-10566, settleRecall(...) receives the recallβs query, scope, id, ids, detailOffset, detailLimit, outputIndex, toolUseId, contentPosition, finalized accumulator, and abort signal; unexpected non-abort/non-RecallContinuationFailure errors are normalized to new RecallContinuationFailure("recall_execution"), while returned anchor text, commit, and rollback actions are accumulated transactionally.packages/gateway/src/pipeline.ts:10567-10579, each executed recall creates an encoded anchor chunk with emitTextItem(recall.outputIndex, executed.anchorText, syntheticId); when otherToolSeen is true, the recall item in state.items is replaced with a text item using the same synthetic msg_... identity and the executed anchor text.