Dashboard › opencode-lore › Distillation
6d925c23-29c9-4e97-958f-b591b549e651["lore_tm_v1_YriSff-SumvCdR8cvGxv7j4oECDSl_QE2c_jaURKXG4","lore_tm_v1_OGAzPzJiwMr6-0CeSyu9Uie7FsF2PPPoqeyzLkkYhQs","lore_tm_v1_yVLbmOAYCjmO1qtyAH23-2tRU4mMXfACTtZvmGLyg6o","lore_tm_v1_1N6GF0VbMJKb-xijpPg4-2c7UDnPjyMAw3c8rhpra3U"]
Date: Sep 16, 2026
packages/gateway/test/openai-responses-recall-aware-stream.test.ts lines 2610–2671 test that an added-only recall finalized by terminal response.completed arguments executes exactly once: recallCalls becomes 1, query "terminal recall" is passed to onRecall, follow-up text "terminal recall answer" remains visible, and PUBLIC_RECALL_ERROR, "name":"recall", fc_terminal_recall, and call_terminal_recall are absent.packages/gateway/test/openai-responses-recall-aware-stream.test.ts lines 2673–2754 test terminal-discovered recall with sparse output positions: visible text occurs at output_index: 7, recall occurs at output_index: 9, recallCalls is 1, and the merged stream contains "sparse visible text" plus "terminal continuation answer" while hiding query "private terminal recall", result "private result", fc_sparse_terminal_recall, and call_sparse_terminal_recall. The test requires exactly one response.completed, no response.failed, no PUBLIC_GATEWAY_ERROR, and matching visible/terminal output indices via expectVisibleOutputIndicesToMatchTerminal(output).packages/gateway/test/openai-responses-recall-aware-stream.test.ts lines 2756–2819 test that a sparse terminal-discovered recall whose terminal function-call status is "failed" is redacted before status validation. The stream must contain PUBLIC_RECALL_ERROR, omit PUBLIC_GATEWAY_ERROR, "private terminal query", and fc_terminal_failed_sparse_recall; runFollowUp must not run.packages/gateway/test/openai-responses-recall-aware-stream.test.ts lines 4802–4854 test rejection of a late response.reasoning_summary_part.added declaration after a response.reasoning_summary_text.delta; draining the client must produce "response.failed".packages/gateway/test/openai-responses-recall-aware-stream.test.ts lines 4856–4893 test continuation-index overflow using Number.MAX_SAFE_INTEGER as the recall output index. Expected behavior: emit PUBLIC_RECALL_ERROR, never emit "output_index":9007199254740992, and perform zero recall and follow-up side effects (recalls === 0, followUps === 0).packages/gateway/test/openai-responses-recall-aware-stream.test.ts lines 4895–4926 test usage overflow while merging a continuation: principal usage has input_tokens: Number.MAX_SAFE_INTEGER, continuation usage adds input_tokens: 1, output contains PUBLIC_RECALL_ERROR, and invalid JSON usage "input_tokens":null is not emitted.packages/gateway/test/openai-responses-recall-aware-stream.test.ts lines 4928 onward begin a test named "rejects per-response usage overflow before recall side effects" using input_tokens: Number.MAX_SAFE_INTEGER and output_tokens: 1, with a recalled counter intended to verify recall does not occur before validation.packages/gateway/src/pipeline.ts lines 11939 onward define foreground-error relay safeguards including MAX_FOREGROUND_ERROR_BYTES = 64 * 1024, foregroundErrorBodyTimeoutMs, boundedRetryAfter(value: string), readForegroundBody(...), and NonStreamCompletionError.packages/gateway/src/pipeline.ts function accumulateNonStreamResponse sniffs a nominally non-stream response body for SSE even when the upstream response lacks text/event-stream; detected SSE is wrapped in a new Response and processed through strict accumulation/validation, including Codex-specific validation via validation: codex ? "codex" : "public".