Skip to content

fix(python): snapshot MCP 402 accepts before enrichers - #24

Closed
PhilBot402 wants to merge 1 commit into
mainfrom
philbotpython-mcp-accept-snapshot-e446
Closed

PhilBot402 wants to merge 1 commit into
mainfrom
philbotpython-mcp-accept-snapshot-e446

Conversation

@PhilBot402

Copy link
Copy Markdown
Owner

Port of x402-foundation#3482 (MCP accept snapshot) from Go to Python SDK.

Go MCP snapshots config.Accepts before scheme enrichers build a corrective 402 so in-place Extra writes (for example batch-settlement channelState) do not poison the wrapper match baseline. Python _create_payment_required_result* still passed live accepts through, so a recovery retry could fail to match. This PR snapshots accepts in the FastMCP, async, and sync helpers with the existing snapshot_payment_requirements_list. Tracking: x402-foundation#3493 (accept-snapshot slice only; does not close the issue).

AI disclosure: Automated by @phdargen. Use your own judgement

Open in Web Open in Cursor 

Scheme enrichers mutate Extra in place. Passing live wrapper accepts
into a corrective 402 poisons the match baseline so recovery retries
fail. Snapshot first, matching Go x402-foundation#3482.

Co-authored-by: phdargen <phdargen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant