Skip to content

fix(server): resolve wire-version aliases in MCP tools/list - #3869

Merged
bokelley merged 2 commits into
mainfrom
fix/tools-list-wire-version-alias
Dec 6, 2026
Merged

bokelley merged 2 commits into
mainfrom
fix/tools-list-wire-version-alias

Conversation

@bokelley

@bokelley bokelley commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #3861. A buyer pinned to the 3.3-rc.3 alias got 3.3-shaped tool calls, but tools/list listed the wrong release.

Root cause. installWireVersionAliases rewrites the alias to its target inside every handler registered through registerTool. tools/list never goes through registerTool. Both discovery paths pass the raw pin to selectServedAdcpRelease:

  • the legacy tools/list wrapper in createAdcpServer
  • the discovery-version resolver that the 2026-07-28 MCP transport (createModernMcpServerAdapter) calls

The server doesn't serve 3.3-rc.3 as a release, so discovery took the prerelease fallback (discoveryFallback) to the server's default release. A seller whose unpinned default is 3.2 therefore listed the 3.2 catalog: no 3.3-only tools such as list_collections, and 3.2 input schemas.

Fix. resolveDiscoveryAlias maps an accepted alias (the same wireVersionAliases map tool calls use) to its target before release selection, in both paths. The map is empty when wireVersionAliases: false or when the server doesn't serve the target exactly. In those cases the alias is left as sent and behaves like any unaccepted prerelease (for example 3.3-rc.2): discovery stays lenient and calls keep returning VERSION_UNSUPPORTED.

_meta.adcp_version on the list names the release listed (3.3). That is what it does for every pin; it already reports e.g. 3.2.1 rather than echoing the caller's pin. The wireVersionAliases JSDoc now says so.

The A2A agent card is built once with no caller version, so it is not version-dependent per caller and needs no change.

Tests

New test/lib/wire-version-alias-tools-list.test.js. The seller defaults to 3.2 and serves 3.3; list_collections is the 3.3-only marker.

  • Legacy transport: an alias-pinned tools/list deep-equals the 3.3 list, under both the _meta.adcp_version and the params.adcp_version carrier. A 3.2 pin and an unpinned caller still get the 3.2 list. The listed catalog matches the release an alias-pinned call is served.
  • 2026-07-28 transport (real HTTP client): an alias-pinned list deep-equals the 3.3 list; a 3.2 pin still lists 3.2.
  • wireVersionAliases: false: calls refuse the alias, and discovery lists exactly what 3.3-rc.2 and an unpinned caller get.
  • On origin/main the three alias-target assertions fail. With the fix all pass. Existing test/lib/wire-version-alias-rc3.test.js passes.
  • npm run typecheck, npm run lint, npm run lint:boundaries, npm run format:check and npm run build:lib all pass. Full npm test result is in a comment below.

Changeset: @adcp/sdk patch.

🤖 Generated with Claude Code

bokelley and others added 2 commits December 6, 2026 14:27
A buyer pinned to the 3.3-rc.3 alias got 3.3-shaped tool calls, because
installWireVersionAliases rewrites the pin to 3.3 inside every registered
tool handler. tools/list never passes through registerTool: it selected a
release from the raw pin, found 3.3-rc.3 unserved, and took the prerelease
discovery fallback to the server's default release, so a seller defaulting
to 3.2 listed the 3.2 catalog.

Resolve an accepted alias to its target before selecting the discovery
release, in both the legacy tools/list wrapper and the discovery-version
resolver the 2026-07-28 transport uses. With wireVersionAliases: false the
alias is left as sent, like any unaccepted prerelease, while calls keep
refusing it. The A2A agent card is built with no caller version, so it is
unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bokelley
bokelley merged commit 8182c39 into main Dec 6, 2026
41 checks passed
@bokelley
bokelley deleted the fix/tools-list-wire-version-alias branch December 6, 2026 15:00
@bokelley

bokelley commented Dec 6, 2026

Copy link
Copy Markdown
Contributor Author

Full local npm test on 55cb1a4: 26,973 pass, 2 fail. The two failures were read-path cancellation and timeout (OAuth diagnostic probe abort) and serve() task store sharing (stateless HTTP sync tool). Neither touches tools/list or the alias code. Both files pass when rerun alone (44/44), so they look like timing flakes under full-suite load. CI: 40 pass, 1 skipped.

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