Repository navigation
fix(nodejs-client): parse HTTP errors independently of response format - #43968
Open
huyengiang101086-spec wants to merge 2 commits into
Open
huyengiang101086-spec wants to merge 2 commits into
huyengiang101086-spec wants to merge 2 commits into
Conversation
huyengiang101086-spec
requested review from
crazywoola and
laipz8200
as code owners
October 13, 2026 02:47
This was referenced Oct 14, 2026
This was referenced Oct 16, 2026
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
Streaming and binary SDK requests currently decode failed HTTP responses in the requested success format. A 401 JSON response therefore produces a generic authentication message with a
Readablebody, while bytes/arraybuffer requests lose the structured error body in aBuffer.Parse non-success responses through the existing JSON/text parser before mapping the HTTP error. Successful stream/binary decoding and retry policy remain unchanged. Real HTTP regressions cover 401 streaming, 422 bytes, 429 arraybuffer, the JSON-mode control, and malformed JSON error text. Request IDs and Retry-After metadata are preserved.
Fixes #43966
Validation
Windows, Node 24.21.0, repository-locked dependencies:
vp test --coveragefromsdks/nodejs-client/: 116 passed.vp check sdks/nodejs-clientfrom the root: format, lint and type checks passed.vp packfromsdks/nodejs-client/: passed.ChatClient.createChatMessagenow preserves the server message and JSON body in both blocking and streaming modes.git diff --check: passed.Checklist
make lint && make type-check(backend) andvp staged(frontend). (SDK-only; scopedvp checkpassed instead)From Codex