fix: complete thinking streams and canonicalize model IDs - #133
Merged
samueltuyizere merged 3 commits intoAug 20, 2026
Merged
Conversation
This was referenced Aug 12, 2026
…pstream failure Review follow-ups on the thinking-stream and model-canonicalization work: - stream: open thinking content_block_start unsigned. The signature_delta emitted before content_block_stop accumulates onto the start block, so pre-seeding the placeholder made clients see it twice concatenated. - stream: flush the terminal message_delta and message_stop when the upstream read fails after finish_reason arrived. Deferring the merged message_delta to the end of the loop meant a stall or read error after a complete answer dropped both terminal events and made the handler retry the turn on the next model. An error before finish_reason still fails so fallback keeps working. - response: sign the thinking block on the non-streaming path. Clients running the extended-thinking beta discard unsigned thinking blocks, which emptied non-streamed replies the same way the streaming bug did. - stream: extract closeOpenBlock for the four copies of the close-thinking-or-text cascade, and rename writeThinkingBlockStop to closeThinkingBlock since it emits a signature_delta before the stop. - catalog: collapse ResolveShort's three near-identical match passes into one exact-then-case-insensitive loop and correct its stale doc comment. - config: simplify CanonicalModelID to a lowercase lookup. The ambiguity guard was unreachable because every registry key is lowercase; a test now enforces that invariant.
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
signature_deltabefore every thinking block stop and preserve real signatures in reconstructed message responsesmessage_deltaValidation
go test ./... -count=1go vet ./...test -z "$(gofmt -l cmd internal pkg)"node --check internal/gui/assets/app.jsFork scope
The source fork also has SQLite request history, provider usage reconciliation, expanded usage dashboards, themed controls, and public deployment work. Those fork-specific changes are deliberately excluded; this PR contains one upstream-based commit with only the generally applicable protocol and model-resolution fixes.
Fixes #51
Fixes #131