Dashboard › opencode-lore › Distillation
3a374fc8-ff47-46d3-abd2-e234724ec3ef["lore_tm_v1_ohn24895aUtims5Il0HbRD-zLDUxuzf2jNIbPWeZ4p4","lore_tm_v1_q9RtpsdR7L1qvJeEtHXhyhysZtP_1FKJnKj2mgIoYeY","lore_tm_v1_zcQ9R1Aw2U4kEkP6xC7cUEPm-MND1VbI5YLUKzGcQGg","lore_tm_v1_Q_024Gz6fuej-hTssONEH_mjsU1qX7Civ1VzWvmSzlg","lore_tm_v1_Fwb1n6RtwQ3kIacz23fRA5H4-Z625XBgMTpoF13QU54","lore_tm_v1_nXrtJxz9PM_oBCExRAaEBq4yGIcMTYTfGYKURd35FQU","lore_tm_v1_iGzVDmhPIBCAZOV8DpsVYtE4bLdhrb13Zjz1O1r7qLo","lore_tm_v1_tVPWrAc9ZiJKbZBW8yeuMAV1AwW3UtgQTF7kWJcQUAs","lore_tm_v1_wqeteF23ahTiVzBPcnU5OU7JrnqcMMG8Bulst4V13Oo","lore_tm_v1_eGQ30fIl6Or0QhrfbyVB995DhzySzkt_-9irxyhtFy0","lore_tm_v1_OGAJlr8oedrt9_DJbW-QLjw5g4LNDqdSMS2s19i9DZk"]
Date: Sep 16, 2026
packages/gateway/src/pipeline.ts added imports for projectResponsesInProgressEvent and RESPONSES_PROVIDER_FAILURE_LOG and introduced additional Responses lifecycle/failure handling, including preservation of sequence_number and a sanitizedFailure structure.24880457763b6f10831856d01c41bd72d62ddc28 (fix(responses): reject non-monotonic provider failures) with parent a1020a45be1382893a183e2ff39506e78a08fb76.a1020a45be1382893a183e2ff39506e78a08fb76 (fix(responses): preserve trusted failure metadata) with parent 01a6e06b08ba1b54f42c5b4c757ec449eb8e8490.packages/gateway/src/pipeline.ts, packages/gateway/src/stream/openai-responses.ts, packages/gateway/test/openai-responses-recall-aware-stream.test.ts, packages/gateway/test/openai-responses-stream.test.ts, packages/gateway/test/pipeline-streaming.test.ts, and packages/gateway/test/recall-codex-stream.test.ts.c79cc2ec010e22f01961d8eec7bce3a60b8dfcb02c12b9ce4c0de9c5e173cb4d.response.created metadata authoritative through hidden recall and provider failure, and finalizing validated failure usage when cancellation wins terminal backpressure.response.in_progress when it changes the identity established by response.created, rejecting contradictory statuses or hidden output in response.created/response.in_progress snapshots, and rejecting a terminal carrying status in_progress.onComplete.Error("private provider failure") and asserts the client output does not contain private provider failure.event: response.failed and must not expose Upstream response has no body.e02913cfe3f7507cae8a358dab68d27a5960b1fe6eedc5386345cbcc053da488, f596a3263bf661df8884702b00e550d9187f3b369a662ddd989e7ac28540178d, and 5b6b8dc43aae88fc56daad97d7ab55da8ed57ce873d8d0cf347f3eb4e4bed21c.Anthropic translator emits inclusive Responses cache usage, rejection of terminal events with non-monotonic source sequences before accepting usage, finalization of validated failure usage when cancellation wins terminal backpressure, rejection of impossible cache usage before recall side effects, and rejection of cache usage without input_tokens before recall.5b6b8dc43aae88fc56daad97d7ab55da8ed57ce873d8d0cf347f3eb4e4bed21c, 2. f596a3263bf661df8884702b00e550d9187f3b369a662ddd989e7ac28540178d, 3. e02913cfe3f7507cae8a358dab68d27a5960b1fe6eedc5386345cbcc053da488, 4. 2f13d034476b26316abff935a26a74b8e1c516a152e85952daa80aecc50405f3, 5. d9f6777bd96c6fe0b9f1cf028b5f82843284bcc08c492130c96d9bd82c894ba8, 6. fc65ee28f054d358a744ab8a62ac22001fa7fb03f8971816cb83998995541d6d.packages/gateway/src/pipeline.ts dispatches by forwarded.effectiveProtocol: openai-responses uses accumulateResponsesSSEStream() with validation: req.codex ? "codex" : "public", stopAtTerminal: true, and requireCompletedTerminal: true; openai uses accumulateOpenAISSEStream() with strict: true, stopAtTerminal: true, and consumeUntilDone: true; gemini uses accumulateGeminiSSEStream() with strict: true and stopAtTerminal: true; other protocols use accumulateSSEResponse() with strict: true and stopAtTerminal: true.accumulateNonStreamResponse(upstreamResponse, forwarded.effectiveProtocol, req.codex === true, abortScope.signal, true).ResponsesTerminalError, packages/gateway/src/pipeline.ts schedules post-response accounting only after downstreamSettled and one setImmediate; it abandons stale generations, drops the owned provisional key on a confident project conflict, and otherwise calls accountUnsuccessfulResponse() while marking an existing session state _dirty = true.ResponsesTerminalError without recall tool use is converted through nonStreamHttpResponse(), with upstream usage-limit headers copied to the response; other terminal errors return errorResponse(502, "Gateway request failed").stopReason to be one of end_turn, max_tokens, or tool_use; otherwise it throws Error("upstream Gemini request did not complete").packages/gateway/test/codex-usage-provisional.test.ts contains a parameterized test for incomplete values [false, true] named preserves current Codex quota during session header migration (incomplete=${incomplete}).codex.rate_limits; primary.used_percent is calls * 10 with window_minutes: 300 and reset_at: 2000000000, while secondary.used_percent is calls * 20 with window_minutes: 10080 and reset_at: 2000100000.id: "resp_quota", model gpt-5, text Hello quota, usage { inputTokens: 600000, outputTokens: 3 }, and uses stop reason max_tokens only on call 2 when incomplete=true; otherwise it uses end_turn./v1/codex/responses with stream: true, authorization Bearer account-one, provider openai-codex, project path from dirname(harness.dbPath), initial x-session-id: codex-before-plugin, and tools read, write, and shell.x-lore-session-id: codex-after-plugin; after migration, the test expects HTTP 200, exactly 2 upstream calls, exactly 1 active session, header x-codex-primary-used-percent: 20, and header x-codex-secondary-reset-at: 2000100000.codex.rate_limits event, contain event: response.incomplete when incomplete=true or event: response.completed otherwise, and must not expose "input_tokens":600000.packages/gateway/src/pipeline.ts is transferred once by finishForeground(), which copies usage-limit headers and wraps the response body with cleanup using releaseForeground, foregroundAbort.signal, and rollbackRecallPersistence; awaitForeground() releases foreground ownership if an operation throws before transfer.AbortSignal.any([foregroundAbort.signal, AbortSignal.timeout(foregroundErrorBodyTimeoutMs)]); a timeout logs upstream error body read timed out, and the status logs as upstream error: ${upstreamResponse.status}.captureToolPairing400() with exact fields status, errorBody, messages: modifiedReq.messages, layer: result.layer, model: req.model, and sessionID; it then sets the GenAI span to code 2 with message HTTP ${upstreamResponse.status}, ends the span, and returns finishForeground(sanitizedUpstreamErrorResponse(upstreamResponse)).captureToolPairing400() is exported from packages/gateway/src/pipeline.ts at line 2575.