Repository navigation
fix(sdk): retry cleanly truncated backend streams - #68
Draft
adarshh347 wants to merge 1 commit into
Draft
adarshh347 wants to merge 1 commit into
adarshh347 wants to merge 1 commit into
Conversation
This branch has not been deployed
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
Do not treat clean EOF without a protocol completion marker as successful partial OCR. Raise DialectError so the existing synchronous client retry/deadline policy applies. SSE accepts either DONE or a first-choice finish_reason; NDJSON requires done. Existing response cleanup and callback restart semantics are retained.
Independent of #66 and #67, based directly on main. Those address input deduplication and output naming, not backend stream completeness.
Validation
Behavior and limits
Retries may repeat inference and increase compute/cost within the existing configured deadline; this is not cancellation of an in-flight server job. A backend that never emits a recognized terminal marker now fails/retries deliberately. Partial callbacks remain provisional and restart=True marks replacement text. No live paid service, GPU/model inference, native async transport or broader parser validation is claimed.
Implementation, tests and independent review were AI-assisted. Draft for maintainer review.