Repository navigation
fix(sdk): an unidentified reasoning start opens a new block instead of joining the last - #56
Merged
Fodesu merged 1 commit intoSep 25, 2026
Conversation
…f joining the last reasoningAccumulator.index resolved an ID-less part to the most recent block, so a second ReasoningStartPart without an ID merged into the first: texts concatenated and the second block's metadata overwrote the first block's signature, which the provider then fails to verify on replay. ReasoningPart's contract is that blocks are never merged. An unidentified start now always opens a new block. An unidentified delta or end joins the most recent block only when that block is itself unidentified, and opens one otherwise, so a provider that omits block IDs delimits its blocks with their starts alone. This is the rule identified parts already follow: a block is delimited by its start, and whether it has ended does not change where a later part belongs. Every in-tree provider carries an ID, so no live path changes.
Fodesu
force-pushed
the
fix/sdk-reasoning-unidentified-blocks
branch
from
September 25, 2026 06:02
40ecba0 to
31f61e3
Compare
Fodesu
marked this pull request as ready for review
September 25, 2026 06:04
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
301B
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.
Problem
reasoningAccumulator.indexresolved an ID-less part to the most recent block. A secondReasoningStartPartwithout an ID therefore merged into the first block: the texts concatenated and the second block'sProviderMetadataoverwrote the first block's signature, which the provider then fails to verify on replay.ReasoningPartdocuments that blocks are never merged, reordered or dropped.Every in-tree provider carries a block ID today, so this is a latent divergence between the accumulator and its contract rather than a live failure.
Change
This is the rule identified parts already follow: a block is delimited by its start, and whether it has ended does not change where a later part belongs. No new state is added to the accumulator.
Tests
TestToResultKeepsUnidentifiedReasoningBlocksApart(table-driven, 3 cases) throughCollectStream: two delimited blocks, delta without start, unidentified block after an identified one.go vet ./...,go test ./sdk/... ./provider/... -skip Integration,golangci-lint run ./sdk/...all pass.