Fix x402 MCP payment retry metadata - #344
Open
mohamedkuch wants to merge 2 commits into
Open
Conversation
Attach the decoded payment payload to MCP request metadata on the single retry, including task-based tool calls. Clear the cached signature after the attempt and cover payload decoding with regression tests. Fixes apify#343
mohamedkuch
marked this pull request as ready for review
July 28, 2026 14:32
Author
|
@jancurn, could you please review PR #344 when convenient? The change is limited to propagating the freshly decoded x402 payload through |
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
params._meta["x402/payment"]for regular, task, and detached callsLive compatibility proof
Tested the patched build against
https://api.utilia.ink/base/mcpwith released mcpc 0.5.1 as the baseline. The initial call returned payment-required terms, the patched retry settled exactly $0.002 USDC on Base, and the tool returned a successful result.Transaction:
0x1815f8271c194700aa3d178ca1ff4bc76d4c0e82bdea4e0e369008cbfd3e63cbThis was a bounded operator compatibility test. It was not organic traffic.
Validation
pnpm run buildpnpm run lintwith 5 pre-existing warnings and 0 errorspnpm run test:unit: 867 passedFixes #343