Skip to content

Default to v2#193

Merged
jolestar merged 4 commits intomainfrom
default_to_v2
Jan 4, 2026
Merged

Default to v2#193
jolestar merged 4 commits intomainfrom
default_to_v2

Conversation

@jolestar
Copy link
Contributor

@jolestar jolestar commented Jan 4, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 4, 2026 13:42
@vercel
Copy link

vercel bot commented Jan 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
x402x-web Ready Ready Preview, Comment Jan 4, 2026 2:19pm

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 4, 2026

Deploying x402-exec with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8d1f62e
Status: ✅  Deploy successful!
Preview URL: https://393696a7.x402-exec.pages.dev
Branch Preview URL: https://default-to-v2.x402-exec.pages.dev

View logs

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes v2 the default and only supported version of the x402 protocol, deprecating v1. It removes the FACILITATOR_ENABLE_V2 feature flag and attempts to implement backward compatibility by defaulting x402Version to 2 when not explicitly provided.

Key changes:

  • Remove v2 enablement flag (FACILITATOR_ENABLE_V2) and make v2 always enabled
  • Update version detection logic to default x402Version to 2 for backward compatibility
  • Exclude e2e tests from default test runs to improve CI/CD performance

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
typescript/packages/facilitator-sdk/vitest.config.ts Exclude e2e directory from default test runs and update timeout comment
typescript/packages/facilitator-sdk/package.json Bump version to 2.3.1 and update e2e test command to run all e2e tests
typescript/packages/extensions/src/facilitator.ts Add x402Version to top-level request body for verify and settle calls
typescript/packages/extensions/package.json Bump version to 2.3.1
typescript/packages/extensions/package-lock.json Update lockfile version to 2.3.1
typescript/packages/client/package.json Bump version to 2.3.1
scripts/publish-x402.sh Remove entire publish script (185 lines deleted)
scripts/publish-packages.sh Update comments to clarify SDK package testing
facilitator/src/routes/verify.ts Remove enableV2 flag, add version defaulting logic, update documentation
facilitator/src/routes/supported.ts Remove enableV2 flag and simplify v2 availability check
facilitator/src/routes/settle.ts Remove enableV2 flag, add version defaulting logic, update documentation
facilitator/src/routes/index.ts Remove enableV2 flag from route dependencies
facilitator/src/router-settlement-service.ts Remove enableV2 flag and update v2 support logic
facilitator/src/network-utils.ts Remove FACILITATOR_ENABLE_V2 constant and simplify version support check
facilitator/src/index.ts Remove enableV2 flag from configuration
facilitator/src/config.ts Change enabled field to always true and remove conditional v2 enabling logic
Files not reviewed (1)
  • typescript/packages/extensions/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +94 to +101
versionDetection: "x402Version is optional (defaults to 2 for backward compatibility)",
supportedModes: ["v2_router"],
deprecationNotice: "v1 is deprecated - please use x402Version=2",
backwardCompatibility: "If x402Version is not provided, defaults to 2",
body: {
paymentPayload: "PaymentPayload (with x402Version=2)",
paymentRequirements: "PaymentRequirements",
x402Version: "number (required, must be 2)",
x402Version: "number (optional, defaults to 2, must be 2 if provided)",
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation claims backward compatibility and that x402Version defaults to 2, but this is inconsistent with the actual validation logic which requires x402Version to be present. The documentation should either be updated to match the strict validation, or the validation logic should be updated to actually support defaulting.

Copilot uses AI. Check for mistakes.
@jolestar jolestar merged commit e581557 into main Jan 4, 2026
8 checks passed
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