Skip to content

Probe sample envelope always carries resource; thread extensions - #109

Merged
vvillait88 merged 1 commit into
mainfrom
probe-resource-extensions
Aug 18, 2026
Merged

Probe sample envelope always carries resource; thread extensions#109
vvillait88 merged 1 commit into
mainfrom
probe-resource-extensions

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Summary

x402 v2 envelope validators (mppx, and the shared discovery engine behind x402scan and MPPScan) refuse a PAYMENT-REQUIRED header without a resource block, so a discovery-probe sample that omitted it read as "no valid x402 response" on every probe-configured merchant, however correct its accepts were. The same engines read the Bazaar extension's example input to build valid bodies for their follow-up probes, so a probe without extensions got re-probed with junk bodies and the merchant's own validation answers (400/404) were reported as paywall failures.

  • buildDiscoveryProbeResponse: the sample envelope now always carries a v2 resource (explicit resource, the resourceUrl shorthand, or synthesized from the realm, with an http-prefix guard) and threads optional extensions into both the header and the body mirror.
  • Checkout: when discoveryProbe is configured with an x402Sample, the sample inherits resource (the checkout's own url + resourceInfo) and enriched Bazaar extensions from discoveryExtensions; explicit values still win.
  • Version bumped to 2.9.0. Python twin lands in agentscore/python-commerce as 2.7.0. Worked with Varun (fix-all ruling on the scanner-sweep findings).

Type of change

  • Bug fix (no breaking change)
  • New feature (no breaking change)
  • Breaking change (existing callers must update)
  • Docs, tests, or internal maintenance only

Public API

DiscoveryProbeConfig.x402Sample and buildDiscoveryProbeResponse's x402Sample gain optional resource and extensions fields. No caller migration needed: existing configs keep working, and their emitted probes gain the resource (and, under Checkout, the inherited extensions) that validators require. The real 402 path is untouched.

Test plan

New tests: probe emits resource from all three sources (explicit, resourceUrl, synthesized) and mirrors it in the body; extensions thread into header and body; Checkout inheritance test (resource from url+resourceInfo, extensions from discoveryExtensions). bun run test (1817 passed), bun run typecheck, bun run lint all green locally. Deployed-path smoke with mppx validate and the @agentcash/discovery engine follows the consumer bumps in each store repo, this session.

Checklist

  • Tests cover the new behavior, and the suite passes locally
  • Lint, format, and type checks pass
  • Docs and README examples updated if the public surface changed
  • No secrets, credentials, or personal data in the diff or the tests

…p to 2.9.0

x402 v2 envelope validators (mppx, and the shared discovery engine behind
x402scan and MPPScan) refuse a PAYMENT-REQUIRED header without a resource
block, so a discovery-probe sample that omitted it read as 'no valid x402
response' on every probe-configured merchant however correct its accepts
were. The same engines read the Bazaar extension's example input to build
valid bodies for their follow-up probes, so a probe without extensions got
re-probed with junk bodies and the merchant's validation answers (400/404)
were reported as paywall failures.

- buildDiscoveryProbeResponse: the sample envelope now always carries a v2
  resource (explicit resource, resourceUrl shorthand, or synthesized from
  the realm) and threads optional extensions into the header and body.
- Checkout: when discoveryProbe is configured with an x402Sample, the
  sample inherits resource (checkout url + resourceInfo) and enriched
  Bazaar extensions from discoveryExtensions; explicit values still win.
- Tests pin all three resource sources, the extensions passthrough, and
  the Checkout inheritance; README/CLAUDE.md document the behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vvillait88
vvillait88 merged commit cdb3cb6 into main Aug 18, 2026
6 checks passed
@vvillait88
vvillait88 deleted the probe-resource-extensions branch August 18, 2026 20:14
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