Dashboard › opencode-lore › Distillation
5ea225c5-67fd-4ed2-b361-a9ab7a6b6fda["lore_tm_v1_7I2hB_NrE-0KluhYOAdDEmqbbRbT-jFQsG6IS0IIjQE","lore_tm_v1_HssCWwWvtNBtjEeUEMXk_SczhO3ngqA0nvDYONrpijg","lore_tm_v1_mLiYGGiLbivi3ASHFdMoQdn_kJmcSfTMZTtumZDm8LQ","lore_tm_v1_r3O-p997st0H0vqsVbyPG0Sm9X3-OG3ky1IKkwHNPG0"]
Date: Sep 16, 2026
// Failed usage/accounting never depends on client demand. in packages/gateway/src/stream/openai-responses.ts around lines 2863-2865; on response.failed, finish(false, finalizeUnsuccessfulResponsesAcc(state)) runs before await waitForDemand().packages/gateway/src/stream/openai-responses.ts changed finish from finish(successful: boolean) to finish(successful: boolean, response?: GatewayResponse), with onComplete(response ?? finalizeResponsesAcc(state), successful).response.failed payload before completing local accounting: id: state.id || "resp_error", object: "response", created_at: state.createdAt ?? 0, model: state.model, status: "failed", output: [], usage: null, and error: { type: "server_error", message: PUBLIC_GATEWAY_ERROR }; it then calls finish(false, finalizeUnsuccessfulResponsesAcc(state)).await opts.onValidatedEvent?.(event, data) and breaks when opts.stopAtTerminal is true.packages/gateway/src/pipeline.ts was modified to import/use cloneResponsesAccState and RESPONSES_PROVIDER_FAILURE_LOG, and added provider-failure/terminal rollback state including continuationProviderFailureSeen, normalizationStateBeforeTerminal, terminalRecallSnapshot, and terminalOutputSnapshot.// Replace accumulated text with the final version (more reliable) in packages/gateway/src/stream/openai-responses.ts around line 814.codexRateLimits matches across the gateway: packages/gateway/src/pipeline.ts lines 18679-18682 merges currentResp.codexRateLimits with continuationResp.codexRateLimits; packages/gateway/src/translate/types.ts line 349 declares codexRateLimits?: Array<Record<string, unknown>>; packages/gateway/src/translate/openai-responses.ts line 1281 iterates resp.codexRateLimits ?? []; and packages/gateway/src/stream/openai-responses.ts line 63 declares the field, line 729 appends quota records, lines 1048-1049 include it in finalized state, and lines 1065-1066 include a structuredClone(state.codexRateLimits) copy.