Refresh MCP HTTP helper headers after authorization failures - #41400
Merged
copyberry[bot] merged 1 commit intoAug 28, 2026
Conversation
## What changed - Re-run the HTTP headers helper after a same-origin `POST` receives a `401` or `403`, and retry the request once when the effective headers changed. - Share refreshes across concurrent rejected requests, retain the previous headers when refresh fails, and keep the retry within the original timeout. - Allow helpers to supply `Authorization` while preserving explicit OAuth or bearer credentials, OAuth insufficient-scope challenges, and redirect safety checks. ## Testing - Cover rotating helper headers for MCP tool calls and same-origin OAuth token refreshes. - Cover concurrent rejections, failed and unchanged refreshes, retry limits, timeouts, and redirects. GitOrigin-RevId: c662edefdb1cd2876d9d02545a72d5bd6739864f
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/c662edefdb1cd2876d9d02545a72d5bd6739864f
branch
from
August 28, 2026 19:30
abddcef to
d9511fb
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/c662edefdb1cd2876d9d02545a72d5bd6739864f
branch
August 28, 2026 19:31
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Refresh MCP HTTP helper headers after authorization failures
What changed
POSTreceives a401or403, and retry the request once when the effective headers changed.Authorizationwhile preserving explicit OAuth or bearer credentials, OAuth insufficient-scope challenges, and redirect safety checks.Testing