fix(python): return EXTENSION-RESPONSES on settle/verify - #4
Draft
PhilBot402 wants to merge 2 commits into
Draft
PhilBot402 wants to merge 2 commits into
PhilBot402 wants to merge 2 commits into
Conversation
Attach decoded EXTENSION-RESPONSES header to VerifyResponse and SettleResponse when the JSON body omits extensions. Body values win; malformed headers do not fail payment success. Co-authored-by: PhilBot <PhilBot402@users.noreply.github.com>
Co-authored-by: PhilBot <PhilBot402@users.noreply.github.com>
Eras256
added a commit
to Eras256/Periplo
that referenced
this pull request
Aug 30, 2026
Verified live before writing, none copied from the draft numbers as given: #3278 (TS, Bartok9) still open; #3301 (Go, wnjoon), explicitly refing #3270 and #3278 as a Go parity follow-up, open; PhilBot402/x402#4 (Python, a fork PR, still a draft), also linking back to #3270 directly, open. Same format as the existing #3098/#3121 traction entries: dated, evidence-linked, merge status stated plainly rather than assumed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Eras256
added a commit
to Eras256/Periplo
that referenced
this pull request
Aug 30, 2026
Not a new topic, the natural continuation of the same agentpayments.fi integration story: that real settlement is what surfaced x402-foundation/x402#3270 (HTTPFacilitatorClient discarding EXTENSION-RESPONSES), now generating fixes in three separate SDKs. Verified live before writing, none of the three changed since the last check: #3278 (TS) open, #3301 (Go) open, PhilBot402/x402#4 (Python, draft) open. Points to README.md's existing detailed block rather than duplicating it. Section stays "1 minute," same format, no new section number. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Eras256
added a commit
to Eras256/Periplo
that referenced
this pull request
Sep 3, 2026
- #3301 (Go) merged 2026-09-02T12:57:19Z by phdargen, verified against its real diff (ExtensionResponses field, leak-prevention regression test), closing the 'presumably needing the same realignment' gap. PhilBot402/x402#4 (Python) remains open in its own fork, never proposed against upstream. - #3336 (feeBumpSigner) merged 2026-09-03T07:02:08Z by phdargen, given the same 'Own PR, merged <date> by <user>' credit already used for #103/#3306/#3278 instead of the stale 'fixed, not just filed'. Both corrections found via a live README+docs sweep against the GitHub API, not assumed from prior session state. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Description
Python
HTTPFacilitatorClientandHTTPFacilitatorClientSynclogged theEXTENSION-RESPONSESheader on successful verify/settle but never attached decoded extensions toVerifyResponse/SettleResponse. Callers expectingresult.extensionsgotNonewhen the facilitator sent extension metadata only in the header.Root cause:
_log_extension_responses_headerinpython/x402/http/facilitator_client.pydecoded the header for logging, then_verify_http/_settle_httpreturned the body-parsed model without merging header extensions.This change extracts header extensions, keeps the sanitized allowlist log, and attaches them when
result.extensions is None. Body values win entirely ({}is preserved viais None, not truthiness). Malformed or non-object headers are ignored without failing payment success.Related to x402-foundation#3270
AI disclosure: The majority of this PR was generated with Cursor Cloud Agent assistance; changes were reviewed and validated with unit tests.
Tests
From
python/x402/:Added regression tests for header-only attach (async verify/settle, sync settle), body wins, empty body map wins, malformed header, and non-object JSON header.
Checklist
python/x402/changelog.d/4.bugfix.md)