fix: preserve transient OAuth discovery HTTP errors - #1071
Merged
DaleSeo merged 2 commits intoJul 28, 2026
Merged
Conversation
tsarlandie-oai
marked this pull request as ready for review
July 28, 2026 16:58
DaleSeo
previously approved these changes
Jul 28, 2026
DaleSeo
left a comment
Member
There was a problem hiding this comment.
Thanks for tightening the discovery error boundary!
| if status.is_server_error() | ||
| || matches!( | ||
| status, | ||
| StatusCode::REQUEST_TIMEOUT | StatusCode::TOO_MANY_REQUESTS |
Member
There was a problem hiding this comment.
Would 425 would make the transient classification more complete?
tsarlandie-oai
force-pushed
the
codex/oauth-discovery-transient-http-errors
branch
from
July 28, 2026 18:53
7d80f6d to
bf9e7c5
Compare
DaleSeo
approved these changes
Jul 28, 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
Follow-up to #1069.
OAuth metadata discovery now preserves transport failures and HTTP 5xx responses, but HTTP
408 Request Timeout,425 Too Early, and429 Too Many Requestsstill fall through as though a metadata endpoint were absent. As a result, a temporary timeout, early-data rejection, or rate limit can cause discovery to continue to another endpoint or report a legacy fallback instead of surfacing the operational failure.This change classifies HTTP 408, 425, and 429 alongside 5xx in the existing
discovery_requesthelper. The resulting metadata error preserves both the actual response status and the failing discovery URL.Compatibility
Regression coverage
Add nine parameterized cases covering HTTP 408, 425, and 429 at each of:
Each case verifies that discovery reports the correct failing URL and status and does not issue additional discovery requests. The regression was first reproduced against upstream
mainbefore applying the production fix.Validation
cargo +1.96 test -p rmcp --lib --all-features(482 tests passing).cargo +1.96 clippy --all-targets --all-features -- -D warnings.cargo +nightly-2025-09-18 fmt --all -- --check.