Skip to content

fix(client): negotiate from the release a seller served when it omits supported_versions - #2025

Merged
bokelley merged 2 commits into
nextfrom
fix/negotiate-from-served-version
Dec 6, 2026
Merged

bokelley merged 2 commits into
nextfrom
fix/negotiate-from-served-version

Conversation

@bokelley

@bokelley bokelley commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Production impact

adcp.supported_versions is optional in get_adcp_capabilities (only major_versions and idempotency are required). When a seller omitted it, ADCPClient assumed the seller spoke 3.0 whenever major_versions contained 3:

if supported is None:
    supported = ["3.0"] if 3 in declared.get("major_versions", []) else []

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 _schema before anything was sent: get_principal has no 3.1 schema and request_account has no 3.2 schema. Tools that did convert reached the seller in the 3.0 shape, with no adcp_version field.

GA TypeScript sellers (@adcp/sdk 17.x with a stable pin and no configured list) omit supported_versions and serve adcp_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_versions is absent, the client now negotiates from the release the seller served on capabilities discovery (_capabilities_wire_version, already captured with the cached capabilities). This matches negotiateAdcpRelease in the TS SDK (src/lib/adapters/version/negotiate.ts, served_version source). The new adcp.compat.versions.supported_versions_from_served() does the work:

Served adcp_version (ceiling 3.3) Negotiated
3.3, 3.3.0, 3.3-rc.3 (built-in alias), 3.3-rc.0 3.3
3.4 (newer line of the same major) the call's ceiling, 3.3
3.2, 3.2.1, 3.2-rc.7 (shipped alias), 3.0 that line
absent (a 3.0 seller that predates adcp_version) 3.0, as before
another major, malformed, or an older prerelease this SDK doesn't ship 3.0, as before
  • A per-call adcp_version still caps the result. A served 3.3 with a 3.2 per-call pin sends 3.2.
  • An advertised supported_versions list still takes precedence over the served release.
  • A preview (non-alias prerelease) ceiling never counts a served echo on its own line as support. Only an exact advertised entry establishes a preview, as in TS.
  • Caching: the served release is stored next to _capabilities in refresh_capabilities and 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], no supported_versions) and covers:

  • the seller serves 3.3: get_principal and request_account go out at 3.3 with no conversion losses;
  • the seller serves 3.2 without a list: the client negotiates 3.2, and request_account is refused before dispatch;
  • the seller serves nothing and declares major 3: 3.0 (get_products goes out with adcp_major_version: 3), and get_principal is refused before dispatch, as before;
  • an advertised list beats the served release, and a per-call ceiling bounds it;
  • cached capabilities keep their served release, and a refresh replaces it;
  • a table of served and ceiling cases for the helper.

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_version already 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

… 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>
@bokelley
bokelley merged commit 17bb846 into next Dec 6, 2026
34 checks passed
@bokelley
bokelley deleted the fix/negotiate-from-served-version branch December 6, 2026 10:51
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