fix(x402): discovery filters out all v2 resources (12,915 of 14,668) - #1400
Open
aoleg8525-ai wants to merge 1 commit into
Open
fix(x402): discovery filters out all v2 resources (12,915 of 14,668)#1400aoleg8525-ai wants to merge 1 commit into
aoleg8525-ai wants to merge 1 commit into
Conversation
🟡 Heimdall Review Status
|
aoleg8525-ai
force-pushed
the
fix/x402-discovery-v2-description
branch
from
August 5, 2026 08:21
87be039 to
0e86317
Compare
The discovery filter read v2 descriptions only from metadata.description. The CDP discovery API returns them at the top level, so filterByDescription dropped every v2 resource and discover_x402_services returned v1 results only. Reading the top-level field first (metadata.description kept as a fallback) restores discovery for v2 resources. v1 handling is unchanged. Signed-off-by: Oleg <oleg@personal.local>
aoleg8525-ai
force-pushed
the
fix/x402-discovery-v2-description
branch
from
August 5, 2026 08:27
0e86317 to
dc15758
Compare
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
discover_x402_servicescurrently returns no v2 resources at all.getResourceDescription(action-providers/x402/utils.ts) reads v2 descriptionsonly from
metadata.description, but the CDP discovery API returns the descriptionat the top level of the resource.
filterByDescriptiontherefore sees an emptystring for every v2 resource and filters all of them out, so agents only ever see
v1 results.
Measured against the default facilitator (
cdp) on 2026-08-05:/discovery/resourcesmetadata.description(what the filter reads)description(what the API returns)filterByDescriptiontodayReproduce in a minute (no key needed):
The fix reads the top-level field first and keeps
metadata.descriptionas afallback, so both shapes work and v1 handling is untouched.
Tests
Added
action-providers/x402/utils.test.ts(8 cases) covering both shapes and theregressions around them:
description→ kept (fails before this change)metadata.description→ kept (backward compatibility)filterByKeywordmatches it"Access to protected content"placeholder → droppedaccepts[].description→ kept, unchangedRun:
eslint,prettier --checkandtsc --noEmitare clean on the touched files.A patch changeset is included.
Note on the manual chatbot walkthrough the template asks for: the change is inside
a pure filter with no wallet or network interaction, and the discovery counts above
come from the live default facilitator rather than a local run.