Repository navigation
feat(transport): expose body-free HTTP status errors - #1386
Merged
DaleSeo merged 4 commits intoOct 23, 2026
Merged
Conversation
Contributor
|
@DaleSeo (assignment failed) is on triage rotation this week and is the reviewer for this one. Labels come from the PR labeler. Please review the change. Automated triage. Labels are a first pass and the assigned maintainer has the final say. |
DaleSeo
reviewed
Oct 22, 2026
4 of 9 tasks
DaleSeo
reviewed
Oct 22, 2026
DaleSeo
previously approved these changes
Oct 22, 2026
DaleSeo
left a comment
Member
There was a problem hiding this comment.
Thanks for addressing my feedback, @theamodhshetty! Approved with one additional comment. Nothing is blocking.
DaleSeo
approved these changes
Oct 23, 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.
HTTP 429 and 5xx failures currently lose Retry-After metadata. This implements the narrow metadata proposal in #1356 (thanks @dux-web for the report and scope).
Adds non-exhaustive
HttpStatusErrorthroughStreamableHttpError::HttpStatus, carrying status and the first valid UTF-8 Retry-After value of at most 128 bytes. A public constructor lets custom backends report the same metadata.GET failures, all HTTP 429 POST responses, and non-JSON POST 5xx failures are classified without reading the body. JSON POST 5xx responses keep the existing JSON-RPC error forwarding, preserving the server's code, message and request id; malformed or non-error JSON falls back to typed HTTP metadata. The metadata retains no body, URL, credentials or other headers. Auth challenges, session expiration, GET 405 and other statuses keep their existing paths. No automatic retries, DELETE changes or client-trait changes.
Remaining body-reader limitation: JSON 5xx error responses must finish before their JSON-RPC error can be recognized. This retains the existing behavior; response-size/time bounds remain related to #1246.
Review follow-up: added the custom-backend constructor, preserved JSON-RPC errors on 5xx, removed the handwritten generated-changelog entry, converted header cases to rstest, grouped imports and removed PR-scope wording from rustdoc.
Validation on macOS arm64 with Rust 1.96.1:
2e8420cand pass oncf40e5b.git diff --checkpass.Previous head
2e8420cpassed upstream CI, conformance and CodeQL. New headcf40e5baddresses the follow-up about JSON 429 responses; hosted checks for that revision are pending.AI assistance: Codex assisted investigation, implementation and local validation.
Fixes #1356.