Repository navigation
Separate streaming parsing, incremental accumulation and instrumentation - #154
Open
Stephen Belanger (Qard) wants to merge 2 commits into
Open
Stephen Belanger (Qard) wants to merge 2 commits into
Stephen Belanger (Qard) wants to merge 2 commits into
Conversation
This was referenced Oct 23, 2026
Stephen Belanger (Qard)
force-pushed
the
refactor/stream-components
branch
from
October 28, 2026 12:05
b183ffb to
d5094cf
Compare
Stephen Belanger (Qard)
changed the base branch from
refactor/release-package-docs
to
refactor/release-msrv-resolution
October 28, 2026 12:05
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 previously retained every raw chunk and reparsed the entire history for each partial update. Separate the OpenAI-compatible parser, normalized updates, incremental accumulator, public output types and span instrumentation. Retain the current provider scope and public stream entry points.
Snapshots now include newly pushed chunks, sparse tool-call indices survive assembly, and overflowing token totals do not panic. Span polling uses a safe state machine without shared async mutexes or atomic counters. Role-only and usage-only chunks do not consume time-to-first-token. Exhaustion observes final delivery; early drop submits partial output and ends the span immediately. Provider errors pass through unchanged and mark the recorded span as failed.
Validation: 445 unit/integration tests and 19 doctests passed (four existing ignored), including fragmented/sparse tool calls, malformed/unknown chunks, usage aliases, snapshot invalidation, EOF, errors and early drop. Strict Clippy, rustdoc, formatting and diff checks passed. Rust 1.86 passed focused streaming/lifecycle tests and package verification with a fresh offline dependency resolution.
Stacked on #152. This implements stage 10 of the pre-release refactor; consumer migration remains separate.