Skip to content

Refresh MCP HTTP helper headers after authorization failures - #41400

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/c662edefdb1cd2876d9d02545a72d5bd6739864f
Aug 28, 2026
Merged

Refresh MCP HTTP helper headers after authorization failures#41400
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/c662edefdb1cd2876d9d02545a72d5bd6739864f

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 28, 2026

Copy link
Copy Markdown

Refresh MCP HTTP helper headers after authorization failures

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.

## 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
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/c662edefdb1cd2876d9d02545a72d5bd6739864f branch from abddcef to d9511fb Compare August 28, 2026 19:30
@copyberry
copyberry Bot merged commit d9511fb into main Aug 28, 2026
27 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/c662edefdb1cd2876d9d02545a72d5bd6739864f branch August 28, 2026 19:31
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 28, 2026
@ilaigold
ilaigold deployed to issue-triage August 28, 2026 19:32 — with GitHub Actions Active
@ilaigold
ilaigold deployed to issue-triage August 28, 2026 19:32 — with GitHub Actions Active
@ilaigold
ilaigold deployed to issue-triage August 28, 2026 19:32 — with GitHub Actions Active
@ilaigold
ilaigold deployed to issue-triage August 28, 2026 19:40 — with GitHub Actions Active
@ilaigold
ilaigold deployed to issue-triage August 28, 2026 19:40 — with GitHub Actions Active
@ilaigold
ilaigold deployed to issue-triage August 28, 2026 19:40 — with GitHub Actions Active
@ilaigold
ilaigold deployed to issue-triage August 28, 2026 19:41 — with GitHub Actions Active
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants