Repository navigation
fix: verify SSE terminal framing before accepting success - #6
Merged
Merged
Conversation
10 tasks done
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.
A stream with a normal finish reason could be reported as successful when
[DONE]was missing or a trailing SSE event was unfinished. Require a complete terminal event as well as a normal finish, observing framing through the existing custom fetch seam while retaining@openrouter/sdk@1.5.91for payload parsing and validation.Preserve previously accepted text and provider/network/consumer/cancellation/timeout precedence, forward source cancellation and errors, and release the source reader. Add 19 completion and lifecycle cases, correct the README's Chat Completions versus Responses API error-code wording, and update the contract, runbook, and changelog.
Validation on Windows / Node 24.18.0:
npm run check: type checks, build, all 136 tests, and the actual packed-package consumer passed.npm run example:demopassed.Observation ends at the first complete
[DONE], matching SDK cancellation. This verifies the application terminal marker; it does not verify HTTP EOF, bytes after the marker, or upstream root cause. All new verification used offline fixtures.