Repository navigation
Track streaming lifecycle outcomes exactly once - #82
Merged
Merged
Conversation
Coverage report
Top uncovered files
|
piotrekno1
force-pushed
the
fix/streaming-lifecycle
branch
from
October 20, 2026 16:14
eb8e066 to
1b0192f
Compare
Merged
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.
Streaming telemetry previously disappeared on early closure or task cancellation, and repeated iteration could emit completion more than once. The shared OpenAI, Anthropic and GGUF stream wrappers now keep one lifecycle state across direct iteration, exhaustion, explicit closure, context exits, cancellation and provider errors.
STREAM_CLOSED; async cancellation emitsSTREAM_CANCELLEDand is re-raised. Partial metadata is retained when supplied, without estimating missing token totals.STREAM_INCOMPLETEinstead of silently losing the operation.Adds a streaming coverage/audit guide. This deliberately describes the existing instrumented iterator paths: OpenAI Chat Completions/Responses
create(stream=True), Anthropicmessages.create(stream=True), and GGUF completion streams. Anthropicmessages.stream()bypasses its patched create method; MLXstream_generate()and Transformers user streamers/background threads also need dedicated adapters. Forwarded provider helpers that consume the underlying stream directly remain outside this iterator contract. Abandoned streams need explicit closure; there is no garbage-collection finalizer.Validation
STREAM_CLOSEDand oneSTREAM_CANCELLEDpreserved in both event data and analytics fields. Run ID:stream-lifecycle-local-6f01b5b57c6f. These were synthetic stream cases, not live provider/model calls.