Dashboard › opencode-lore › Distillation
0c1496bc-d0f7-469b-8f7e-03ec00c1f0d3["lore_tm_v1_enco8daI0eCEoKp0DWSgy4ayUJeyG6Y8yrdHFCD2Vbo","lore_tm_v1_T7CLp-DOsb1WzLozny5IOqM_0c9Bt4zS9ogVyeXeZgk","lore_tm_v1_JqDk9gDpqJKioCSMwMBnhoD577rrOtO6t0fgxrjVYD0","lore_tm_v1_kidR6i7BtRlXGbl3Ijdd1ap7RNvClKSGf8OOy4rMmU4","lore_tm_v1_XTBBD9gqrkFmCVR0KLcPp-WZ5spUC7P33K2cxi1KCwM","lore_tm_v1_iUc9Mtg0GhG3ta_gBnhExSkwZEt2y98wh2Ft89lIIR0"]
Date: Sep 16, 2026
requireValidCompletion, usage fields may be projected and validated, but the projection is “never returned as success” in /home/byk/Code/opencode-lore-provider-error/packages/gateway/src/pipeline.ts near line 12279./home/byk/Code/opencode-lore-provider-error/packages/gateway/src/pipeline.ts near line 15836./home/byk/Code/opencode-lore-provider-error/packages/gateway/test/openai-responses-stream.test.ts found at least 100 references to accumulateResponsesSSEStream or streamResponsesPassthrough; results were truncated because more matches were available./home/byk/Code/opencode-lore-provider-error/packages/gateway/src/llm-adapter.ts lines 2985 and 2996; /home/byk/Code/opencode-lore-provider-error/packages/gateway/src/stream/openai-responses.ts lines 2092, 2711, and 2844; and /home/byk/Code/opencode-lore-provider-error/packages/gateway/src/pipeline.ts lines 7802, 12230, 15475, 15746, 15845, 18567, 18893, 19101, and 19117./home/byk/Code/opencode-lore-provider-error/packages/gateway/src/llm-adapter.ts defines accumulateWorkerSSE(protocol, response, signal?, onSemanticContent?): openai-codex-responses uses accumulateResponsesSSEStream with validation: "codex"; openai-responses uses it with validation: "public"; both set stopAtTerminal: true, inactivityMs: WORKER_RESPONSE_INACTIVITY_MS, and pass signal and onSemanticContent.accumulateWorkerSSE protocol branches in /home/byk/Code/opencode-lore-provider-error/packages/gateway/src/llm-adapter.ts are: gemini → accumulateGeminiSSEStream with strict: true; openai → accumulateOpenAISSEStream with strict: true and consumeUntilDone: true; default Anthropic wire, including Vertex/Bedrock-mantle, → accumulateSSEResponse with strict: true. All set stopAtTerminal: true, inactivityMs: WORKER_RESPONSE_INACTIVITY_MS, and pass signal and onSemanticContent.accumulateWorkerSSE exists because ChatGPT/Copilot/Codex and some OpenAI-compatible providers may return multi-chunk SSE even for non-streaming worker requests, including when text/event-stream is missing or mislabeled; merging every chunk avoids losing deltas and addresses LOREAI-GATEWAY-38 / -1P./home/byk/Code/opencode-lore-provider-error/packages/gateway/src/llm-adapter.ts documents gatewayResponseToWorkerResult(resp) as projecting GatewayResponse to { text, usage, model }; only visible text blocks contribute to worker text, and a pure tool_use response is treated as empty because workers consume text rather than tool calls./home/byk/Code/opencode-lore-provider-error/packages/gateway/src/pipeline.ts defines accumulateNonStreamResponse(upstreamResponse, protocol = "anthropic", codex = false, signal?, requireValidCompletion = false). Supported protocols are "anthropic", "openai", "openai-responses", "vertex", and "gemini".accumulateNonStreamResponse reads the foreground body and uses looksLikeSSE(contentType, body) because providers such as ChatGPT/Copilot/Codex and DeepSeek can return SSE despite stream: false, sometimes without an SSE content type. Detected SSE is reconstructed as a Response with content-type: text/event-stream; otherwise the body is parsed as JSON.accumulateNonStreamResponse: "openai" → accumulateOpenAISSEStream with strict: true, stopAtTerminal: true, and consumeUntilDone: true; "openai-responses" → accumulateResponsesSSEStream with validation: codex ? "codex" : "public", stopAtTerminal: true, and requireCompletedTerminal: true; "gemini" → accumulateGeminiSSEStream with strict: true and stopAtTerminal: true; default Anthropic/Vertex/Bedrock-mantle → accumulateSSEResponse with strict: true and stopAtTerminal: true.accumulateNonStreamResponse: "openai-responses" uses accumulateResponsesNonStreamJSON, "openai" uses accumulateOpenAINonStreamJSON, "gemini" uses parseGeminiResponseJSON, and other protocols use accumulateAnthropicNonStreamJSON. For "openai-responses", parseResponsesNonStreamEnvelope(json) must report status === "completed" or a ResponsesTerminalError(response, parsed.status) is thrown.requireValidCompletion is enabled for non-Responses JSON, assertValidNonStreamCompletion(json, protocol) validates completion. If content parsing fails first, the same parser is rerun on { usage: json.usage, usageMetadata: json.usageMetadata } to preserve numeric and cache-consistency checks; invalid usage still throws, and otherwise NonStreamCompletionError(response) is thrown rather than returning success.