Repository navigation
fix(stream): persist mid-stream failures - #3937
Merged
diegosouzapw merged 1 commit intoJun 15, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Owner
|
Obrigado, @rdself! 🙏 Excelente follow-up do #3879 — fechar o segundo gap do ciclo de vida do stream (falhas mid-stream agora viram call-log de falha durável em vez de sumir da página de Logs) é exatamente o tipo de robustez que faltava. Apreciei muito que a extração do |
diegosouzapw
pushed a commit
that referenced
this pull request
Jun 16, 2026
Integrated into release/v3.8.26 — keep pendingById in sync with the queue detail (Object.assign in place). Validated alongside #3937: typecheck:core clean, 42/42 request-logger + lifecycle tests, eslint 0 errors, file-size OK.
This was referenced Jun 16, 2026
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
Integrated into release/v3.8.26 — mid-stream failure persistence (follow-up to diegosouzapw#3879). Validated locally: typecheck:core clean, 75/75 stream/usage tests, eslint 0 errors, file-size + any-budget OK.
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
Integrated into release/v3.8.26 — keep pendingById in sync with the queue detail (Object.assign in place). Validated alongside diegosouzapw#3937: typecheck:core clean, 42/42 request-logger + lifecycle tests, eslint 0 errors, file-size OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This patch fixes a second stream lifecycle gap on top of the existing v3.8.26 stream readiness work: mid-stream transport/transform failures could clear the active request from memory without going through the chat completion finalization path. In that case the Logs page entry disappeared instead of becoming a durable failed call log, even though the upstream request may already have run for a long time.
Changes
pipeWithDisconnectstream errors through a new controlleronErrorcallback sochatCorecan own request finalization when appropriate.message_startinput/cache tokens are not lost when latermessage_deltachunks only contain output usage.input_tokens/output_tokensin usage normalization for Anthropic-style streams.The upstream request shape is unchanged, including Claude Code compatible provider payloads.
Validation
node --import tsx/esm --test tests/unit/stream-handler.test.ts tests/unit/stream-utils.test.ts tests/unit/active-request-stream-chunks-lifecycle.test.tsnpm run typecheck:core