Repository navigation
Conversation
dimartiro
approved these changes
Nov 3, 2026
Contributor
|
@dhyaniarun1993 would u like to take a look as well? |
Member
Yea, I will review this today. |
This branch has not been deployed
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.
What changed and why
Fixes #79
The first request can carry Request-owned authorization/tenant headers, but the paid retry currently replaces them with a header list constructed only from
init.headers. Inheritinput.headerswhen the input is a Request andinit.headersis undefined, then setX-PAYMENTon a copy. Explicit overrides, including empty header collections, continue to replace the inherited header list.Add native-fetch loopback regressions and a patch changeset for
@chainsafe/x402-server-sdk.Approved plan and scope
The operator approved the written research/plan before implementation and explicitly requested issue/PR publication. Relevant approved plan slice:
init.headerswhen defined; otherwise inherit headers from a Request input.X-PAYMENTheader.Acceptance criteria are recorded in the linked issue. This is a header-only fix. Consumed Request bodies and ReadableStream replay remain subject to the existing documented exclusions.
Validation
On Node 24.22.2 (matching
.nvmrc):pnpm build pnpm typecheck pnpm lint pnpm testAll passed: 133 workspace tests, including 32 SDK tests / 22 fetch tests. Seven header-regression cases fail on the original source and pass after the fix. Tests exercise native fetch against a loopback merchant with fixture-only authorization, without live Canton traffic. Two fresh independent Codex reviewers reviewed the final commit and ran their own checks before publication.
Operational impact
No environment variables, secrets, config keys, schemas, ports, dependencies, or deployment steps change. No public type/signature changes. Paid retries retain effective caller headers as native fetch semantics require; callers providing explicit
init.headersretain full-replacement behavior.Assumptions and scope
Request detection uses the runtime's native
Requestconstructor. Cross-realm Request detection is not introduced. The only additional files are regression tests and the required release changeset.AI-assisted code and PR description, prepared with Codex following
chainsafe-research-plan-implement; operator-approved plan as quoted above. All PR commits are SSH-signed. Maintainer review and merge remain with the project.