Repository navigation
fix(server): resolve wire-version aliases in MCP tools/list - #3869
Merged
Merged
Conversation
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>
Contributor
Author
|
Full local |
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
Follow-up to #3861. A buyer pinned to the
3.3-rc.3alias got 3.3-shaped tool calls, buttools/listlisted the wrong release.Root cause.
installWireVersionAliasesrewrites the alias to its target inside every handler registered throughregisterTool.tools/listnever goes throughregisterTool. Both discovery paths pass the raw pin toselectServedAdcpRelease:tools/listwrapper increateAdcpServercreateModernMcpServerAdapter) callsThe server doesn't serve
3.3-rc.3as 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 aslist_collections, and 3.2 input schemas.Fix.
resolveDiscoveryAliasmaps an accepted alias (the samewireVersionAliasesmap tool calls use) to its target before release selection, in both paths. The map is empty whenwireVersionAliases: falseor 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 example3.3-rc.2): discovery stays lenient and calls keep returningVERSION_UNSUPPORTED._meta.adcp_versionon the list names the release listed (3.3). That is what it does for every pin; it already reports e.g.3.2.1rather than echoing the caller's pin. ThewireVersionAliasesJSDoc 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_collectionsis the 3.3-only marker.tools/listdeep-equals the 3.3 list, under both the_meta.adcp_versionand theparams.adcp_versioncarrier. 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.wireVersionAliases: false: calls refuse the alias, and discovery lists exactly what3.3-rc.2and an unpinned caller get.origin/mainthe three alias-target assertions fail. With the fix all pass. Existingtest/lib/wire-version-alias-rc3.test.jspasses.npm run typecheck,npm run lint,npm run lint:boundaries,npm run format:checkandnpm run build:liball pass. Fullnpm testresult is in a comment below.Changeset:
@adcp/sdkpatch.🤖 Generated with Claude Code