feat: add aggregate /.well-known/x402 and external buyer-tool compat - #806
Open
HananINouman wants to merge 7 commits into
Open
feat: add aggregate /.well-known/x402 and external buyer-tool compat#806HananINouman wants to merge 7 commits into
HananINouman wants to merge 7 commits into
Conversation
Publish AgentCash/x402scan discovery fallback on the shared storefront, surface AgentCash/Bankr buy prompts, and gate the path with flow-22 (generic x402 SDK + agent chat-completions) in release-smoke. Co-authored-by: Cursor <cursoragent@cursor.com>
Skip settle on client disconnect/write errors, classify facilitator rejections, and teach HTTP buyers Bankr chat auto-pay while agent/inference use wallet-sign plus long curl after live timeout and voucher failures. Co-authored-by: Cursor <cursoragent@cursor.com>
Publish type-specific Poncho chat prompts alongside AgentCash/Bankr and surface them in the storefront pill selector after a successful live pay test. Co-authored-by: Cursor <cursoragent@cursor.com>
HananINouman
marked this pull request as ready for review
August 5, 2026 18:40
Record that a Bankr App with pay:x402 + allowedHosts still hit rpc timeout on Base mainnet agent offers; drop the Sepolia digression and clarify HandleProxy settle-skip vs ForwardAuth verify-only. Co-authored-by: Cursor <cursoragent@cursor.com>
bussyjd
added a commit
that referenced
this pull request
Aug 6, 2026
…-rc2 Brings the aggregate /.well-known/x402 discovery doc and external buyer-tool compat (Merit/AgentCash/Poncho, Bankr) into rc2. Conflict resolution — both sides were additive, both kept: - catalog.go: the static-site match/hash now folds in BOTH the widget's embedded chat-vendor.js (rc2) and the new x402.json (#806), so a stale copy of either re-applies the ConfigMap. - forwardauth_test.go: kept TestBuildResourceURL_Scheme (rc2) alongside #806's brokenPipeWriter settle-skip tests. - Widget-era test call sites updated for the new wellKnownX402JSON param. Claude-Session: https://claude.ai/code/session_01PnhCQLz7CHuDBUhWd5xF8v
bussyjd
added a commit
that referenced
this pull request
Aug 6, 2026
…SON param The #806 merge added a wellKnownX402JSON parameter to buildStaticSiteConfigMap/staticSiteContentMatches, but four widget-era call sites in catalog_test.go and hostoffer_test.go were left at the old arity, so the package failed to build its tests. Pass "" (these tests do not exercise the aggregate x402 document). Claude-Session: https://claude.ai/code/session_01PnhCQLz7CHuDBUhWd5xF8v
…njection) CodeQL flagged four new go/log-injection alerts introduced by this PR in internal/x402/forwardauth.go: the buyer's payment payload and the facilitator's reject reason reach log.Printf unescaped, so a crafted value containing CRLF can forge additional lines in the operator's log (e.g. a fake "payment settled successfully" entry). Fix at the producers rather than at each log call, so future call sites inherit it: paymentPayloadSummary, facilitatorRejectDetail and the normalize note now return CR/LF-stripped strings, and truncateForLog sanitizes too (it carries the raw facilitator /verify body). Claude-Session: https://claude.ai/code/session_01PnhCQLz7CHuDBUhWd5xF8v
bussyjd
force-pushed
the
feat/external-buyer-tool-compat
branch
from
August 6, 2026 12:48
5e15e33 to
a5d6972
Compare
bussyjd
added a commit
that referenced
this pull request
Aug 6, 2026
…-rc2
Brings the aggregate /.well-known/x402 + external buyer-tool compat work
along with its CodeQL go/log-injection fix.
Conflict resolutions (both additive — kept BOTH sides, not one over the
other):
* catalog.go — the static-site match and content hash now fold in both
the widget's embedded chat-vendor.js (rc2) and the new x402.json
(#806). Dropping either side would silently pin a stale copy of that
asset across controller upgrades via the skip-when-unchanged path.
* forwardauth_test.go — kept rc2's TestBuildResourceURL_Scheme
alongside #806's brokenPipeWriter settle-skip tests.
Also updates four widget-era test call sites in catalog_test.go and
hostoffer_test.go for #806's new wellKnownX402JSON parameter (they pass
"" — those tests do not exercise the aggregate x402 document). Without
this the package does not build its tests.
Replaces the unsigned a128bdf/dd9c5a1d/cdee3a22 with a single signed
merge; the resulting tree is byte-identical to cdee3a2.
Claude-Session: https://claude.ai/code/session_01PnhCQLz7CHuDBUhWd5xF8v
bussyjd
approved these changes
Aug 6, 2026
…ecks Drop chatty framing, require AgentCash/Poncho tx receipts, and teach Bankr agent buyers to reuse the full accepts[] entry to avoid unsupported_scheme. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
Makes Obol Stack storefront offers work with external x402 buyers — especially Merit Systems (AgentCash / x402scan / Poncho) and Bankr — via discovery docs, verifier hardenings, type-specific buy prompts, and flow-22.
Merit discovery (AgentCash / Poncho / x402scan)
Merit products share one discovery convention:
/openapi.jsonwith per-opx-payment-info/.well-known/x402for crawlers that don’t parse OpenAPIThis PR adds aggregate public
/.well-known/x402, keeps/strengthens OpenAPIx-payment-info, defaults undeclared paid HTTP ops to GET (AgentCash-friendly), and documents both surfaces in skill.md / catalog.Why AgentCash and Poncho share a flow: both are Merit. Poncho (tryponcho.com) is consumer chat; AgentCash is the micropayment/wallet layer. Same discovery → same 402 → sign → retry. Storefront pills differ mainly by “paste into AgentCash vs Poncho.” Live Base tests: both paid our HTTP offer successfully.
Bankr (live Base mainnet)
Bankr chat / CLI / Apps are different clients. Docs mention discovery-index / Apps
allowedHosts, but allowlisting alone does not fix agents: we built a Bankr App withpay:x402+allowedHostsfor our tunnel andbankr.x402.fetchagainst bounty-radar — payment often verified, then the App failed withrpc timeout~30s while the agent was still running. HTTP through the same App/chat path usually works (~1s).bankr x402 callbankr.x402.fetch(with allowlist)rpc timeoutafter verifybankr wallet sign+ curl ≥180sTwo failure modes: (A) voucher (
validAfter=now/ bad sig → verify reject, usually no charge); (B) timeout/zombie (verify OK, client aborts ~30s; older sellers could still settle → on-chain charge). Seller side: skip settle on disconnect/write error/empty SSE; better facilitator error labels; dual CAIP-2+legacyaccepts[];PAYMENT-SIGNATURE+ v=0/1→27/28; structured post-verify upstream errors.Prompts we publish: HTTP → Bankr chat auto-pay; agent/inference → forbid chat/Apps/
x402 call, teachbankr wallet sign+curl --max-time 300with pastvalidAfterandstream:true.Storefront / CI / docs
buyprompts→/api/services.json)flow-22-external-buyer-compat.sh+ generic x402 SDK buyer; release-smoke hookdocs/observability.md,CLAUDE.mdpitfall 23, buy-x402 skill noteTest plan
GET <tunnel>/.well-known/x402+ OpenAPIx-payment-infoon paid opsgo test ./internal/buyprompts/ ./internal/x402/ ./internal/serviceoffercontroller/Poncho chat, agent offer
Bankr wallet+cursor curl, agent offer
Agentcash(skill/cli/mcp) connected to cursor , agent offer
Bankr chat, http offer