Repository navigation
fix(client): negotiate from the release a seller served when it omits supported_versions - #2025
Merged
Merged
Conversation
… supported_versions adcp.supported_versions is optional in get_adcp_capabilities. When a seller omitted it, the client assumed 3.0 whenever major_versions held 3, then down-converted every 3.3 request to 3.0. Tools with no 3.0 schema (get_principal, request_account) failed client-side before anything was sent. Default GA TypeScript sellers (@adcp/sdk 17.x) omit the list and serve adcp_version "3.3", so every Python 10.x buyer was held to 3.0 against them (adcontextprotocol/adcp nightly interop run 47618268520). Without a list, the release the seller served on discovery is now the evidence, as in the TypeScript SDK's negotiateAdcpRelease: - served on the call's line or a newer line of the major: the call's ceiling (3.3, 3.3.0, 3.3-rc.3, 3.3-rc.0 and 3.4 all negotiate 3.3); - served an older line this SDK ships (3.2, 3.2.1, 3.2-rc.7): that line; - no served release, cross-major, malformed, or an unshipped older prerelease: the major-only rule (3.0) as before. The served release is cached with the capabilities it came from and is replaced on refresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Production impact
adcp.supported_versionsis optional inget_adcp_capabilities(onlymajor_versionsandidempotencyare required). When a seller omitted it,ADCPClientassumed the seller spoke 3.0 whenevermajor_versionscontained 3:It then down-converted every 3.3 request to 3.0. For tools that have no older schema, the conversion failed in
compat/versions.py_schemabefore anything was sent:get_principalhas no 3.1 schema andrequest_accounthas no 3.2 schema. Tools that did convert reached the seller in the 3.0 shape, with noadcp_versionfield.GA TypeScript sellers (
@adcp/sdk17.x with a stable pin and no configured list) omitsupported_versionsand serveadcp_version: "3.3". So every Python 10.x buyer talking to a default GA TS seller was held to 3.0 in production. The adcp nightly interop matrix caught this in adcontextprotocol/adcp run 47618268520.Fix
When
supported_versionsis absent, the client now negotiates from the release the seller served on capabilities discovery (_capabilities_wire_version, already captured with the cached capabilities). This matchesnegotiateAdcpReleasein the TS SDK (src/lib/adapters/version/negotiate.ts,served_versionsource). The newadcp.compat.versions.supported_versions_from_served()does the work:adcp_version(ceiling 3.3)3.3,3.3.0,3.3-rc.3(built-in alias),3.3-rc.03.4(newer line of the same major)3.2,3.2.1,3.2-rc.7(shipped alias),3.0adcp_version)adcp_versionstill caps the result. A served 3.3 with a 3.2 per-call pin sends 3.2.supported_versionslist still takes precedence over the served release._capabilitiesinrefresh_capabilitiesand replaced on each refresh, so a cached response and its served release always match.Tests
New file
tests/test_negotiate_from_served_version.py. It uses a fake seller that mirrors the TS 17.1 capabilities shape (adcp_version: "3.3",major_versions: [3], nosupported_versions) and covers:get_principalandrequest_accountgo out at 3.3 with no conversion losses;request_accountis refused before dispatch;get_productsgoes out withadcp_major_version: 3), andget_principalis refused before dispatch, as before;Before the fix, 5 of the new tests fail. Full suite: 23551 passed, 3330 skipped, 1 xfailed. ruff, black and mypy are clean.
Follow-up (not in this PR)
compat/negotiated_catalog_purchase._negotiate_versionalready falls back to[wire_version]. It still refuses a served release newer than the client (for example 3.4), where this path now uses the client's ceiling.🤖 Generated with Claude Code