Repository navigation
Propagate known provider SSE error events - #379
Merged
mattt merged 1 commit intoNov 1, 2026
Merged
Conversation
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.
Closes #378.
An HTTP 200 SSE response could contain a provider error while the session still finished successfully with its partial answer. An error-only stream instead lost the provider diagnostic behind
noSnapshots. This affects Anthropic, OpenAI Chat Completions, OpenAI Responses, OpenResponses and Gemini.Recognize their known error envelopes in the shared SSE reader before normal chunk decoding can ignore them. Throw the existing
HTTPTransportErrorusing a new static value on its extensibleKindstruct,.providerError, retaining the actual HTTP response/headers and the failed event's JSON payload. No public enum cases or public provider-specific error types are added. Unknown informational/ping events, invalid unrecognized chunks,[DONE], existingresponse.failed, HTTP errors and cancellation retain their behavior. README documents the new diagnostic surface.Validation (Apple Swift 6.4, macOS arm64, committed resolved versions):
response.failed, non-2xx and cancellation coverage.swift build, repository-wideswift format lint --strict --recursive .andgit diff --checkpass.--build-system native --disable-default-traits --force-resolved-versions --jobs 2to avoid downloading or running local inference stacks. No lockfile change.No live/paid provider calls, native Foundation Models inference, MLX/Llama/CoreML, AsyncHTTPClient trait or other OS/Swift versions were tested. The native-build-system deprecation and existing test deprecation/Sendable warnings remain visible in the logs.