Skip to content

fix: verify SSE terminal framing before accepting success - #6

Merged
dannymitchelldev merged 1 commit into
mainfrom
codex/sse-completion-observation
Nov 15, 2026
Merged

dannymitchelldev merged 1 commit into
mainfrom
codex/sse-completion-observation

Conversation

@dannymitchelldev

Copy link
Copy Markdown
Owner

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.91 for 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:demo passed.
  • Independent read-only AI review found no actionable defects.

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.

@dannymitchelldev
dannymitchelldev merged commit 77e32d3 into main Nov 15, 2026
4 checks passed
@dannymitchelldev
dannymitchelldev deleted the codex/sse-completion-observation branch November 15, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant