Skip to content

fix: protocol handler retries use OAuth-authenticated fetch#150

Merged
badjer merged 2 commits intomainfrom
fix/protocol-handler-auth-fetch
Apr 7, 2026
Merged

fix: protocol handler retries use OAuth-authenticated fetch#150
badjer merged 2 commits intomainfrom
fix/protocol-handler-auth-fetch

Conversation

@badjer
Copy link
Copy Markdown
Contributor

@badjer badjer commented Apr 7, 2026

Summary

Protocol handler retries (ATXPAccountHandler, X402, MPP) were using raw fetchFn which didn't include the OAuth Bearer token. MCP servers require both the payment credential header AND the Bearer token. Retries were getting 401 responses.

Changed getProtocolConfig() to wrap oauthClient.fetch so retries include the Bearer token from the cached OAuth session.

Found during E2E testing of Phase 3.9 ATXP pull mode.

Test plan

  • ATXP pull mode: ATXPAccountHandler retry includes Bearer + X-ATXP-PAYMENT → settle-at-start → charge → Result returned

🤖 Generated with Claude Code

badjer and others added 2 commits April 7, 2026 11:20
Protocol handlers (ATXPAccountHandler, X402, MPP) retry requests using
fetchFn from ProtocolConfig. Previously this was the raw fetch, so retries
were missing the OAuth Bearer token. MCP servers require both the payment
credential header AND the Bearer token.

Changed getProtocolConfig() to wrap oauthClient.fetch so retries include
the Bearer token from the cached OAuth session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds integration test that exercises the full ATXPAccountHandler retry path
and asserts the retry request includes both X-ATXP-PAYMENT and
Authorization: Bearer headers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@badjer badjer merged commit 75ec9e0 into main Apr 7, 2026
1 check passed
@badjer badjer deleted the fix/protocol-handler-auth-fetch branch April 7, 2026 18:38
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