Skip to content

fix(cloudflare): Treat OAuth probe 4xx as expired#862

Merged
dcramer merged 1 commit intomainfrom
fix/oauth-probe-4xx-expiry
Mar 26, 2026
Merged

fix(cloudflare): Treat OAuth probe 4xx as expired#862
dcramer merged 1 commit intomainfrom
fix/oauth-probe-4xx-expiry

Conversation

@dcramer
Copy link
Copy Markdown
Member

@dcramer dcramer commented Mar 26, 2026

Treat the refresh-token probe's client-side failures as an expected sign that the stored Sentry token is no longer usable.

While investigating MCP-SERVER-F9Q, the upstream /auth/ probe was returning 400 for invalid or expired bearer tokens. The refresh path only treated 401 authentication failures as expected, so these 400 responses were being logged as issues even though they should fall through to re-auth.

This broadens the probe guard to all ApiClientError responses and keeps the regression coverage focused on the 400 probe behavior without asserting on telemetry internals.

Fixes MCP-SERVER-F9Q

Treat client-side failures from the upstream /auth/ probe as an expected
signal that the stored Sentry token is no longer usable.

Sentry can return 400 as well as 401 for invalid or expired bearer tokens,
so limiting the fallback to ApiAuthenticationError created noisy issue
reporting during refresh token exchange.

Keep the regression coverage focused on probe behavior without asserting on
telemetry internals.

Fixes MCP-SERVER-F9Q
Co-Authored-By: OpenAI Codex <noreply@openai.com>
@dcramer dcramer marked this pull request as ready for review March 26, 2026 04:33
@dcramer dcramer merged commit 930ddd0 into main Mar 26, 2026
15 checks passed
@dcramer dcramer deleted the fix/oauth-probe-4xx-expiry branch March 26, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant