Skip to content

fix(client): version-neutral capability discovery and retryable MCP negotiation failures - #3860

Merged
bokelley merged 7 commits into
mainfrom
fix/version-neutral-discovery-and-negotiation-errors
Dec 5, 2026
Merged

bokelley merged 7 commits into
mainfrom
fix/version-neutral-discovery-and-negotiation-errors

Conversation

@bokelley

@bokelley bokelley commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Two negotiation fixes from moving a TS 17.0.0 buyer and a Python 10.0.0 seller to AdCP 3.3 GA.

#3856: capability discovery is version-neutral for every client

get_adcp_capabilities discovery now goes out without adcp_version / adcp_major_version for every client pin. Before, only a preview pin did. Discovery establishes the version, AdCP 3.3 says a buyer sends a release only after the peer lists it, and a strict 3.0 seller that refuses a versioned discovery call failed discovery from a 17.0 buyer.

Re-probe. The client negotiates from the unpinned answer's supported_versions (negotiateAdcpRelease). When that differs from the release the seller echoed, it re-probes once at the negotiated release and keeps that answer. This is what 17.0 effectively did by pinning:

  • 3.3 client, seller ['3.2','4.0']: the 4.0 answer is replaced by the 3.2 answer;
  • 3.1 client, seller ['3.0','3.2','3.3']: the 3.0 answer, sent major-only;
  • an exactly listed preview: the preview answer, as before.

There are never more than two calls, and a failed re-probe (429) keeps the unpinned answer. An answer with no echo is kept, because it marks a 3.0-era seller; the exception is an exactly listed preview pin.

Other details.

  • The internal probe carries no webhook. An unpinned push_notification_config falls back to the pre-3.1 shape with no registration.
  • versionEnvelope: 'auto' still sends the versioned call, and it is not retried.
  • Migration: every client's first discovery call is now unversioned. A client pinned below the seller's newest release may make a second, pinned discovery call.

#3858: transient failures during MCP version negotiation are marked

A 408/425/429/500/502/503/504 answer to @modelcontextprotocol/client's negotiated connect still throws the MCP client's SdkHttpError unchanged (code, name, status), and adds transient: true, retryable: true and retryAfterMs.

  • isTransientMCPNegotiationFailure() matches without instanceof.
  • MCPNegotiationTransportError (code: 'MCP_NEGOTIATION_TRANSPORT_FAILED') is a failed task result's errorInstance. MCP endpoint discovery also throws it, instead of blaming agent_uri, when the registered URL answered that way. 429, and 503 with Retry-After, still throw AgentRateLimitedError.
  • No MCP classes are re-exported. @modelcontextprotocol/client 2.3 brands its errors, so instanceof SdkHttpError holds across copies; the test asserts it.

Tests

New and updated cases:

  • the strict 3.0 seller refusing versioned discovery;
  • the ['3.2','4.0'], ['3.0','3.2','3.3'], already-served, throttled re-probe and no-common-release cases;
  • 502/503/504/429/401 negotiation failures, errorInstance, and endpoint discovery.

The 12 related files pass (216 tests), and the full local npm test passes on this head.

Changeset: minor.

Closes #3856
Closes #3858

🤖 Generated with Claude Code

bokelley and others added 6 commits December 5, 2026 11:47
…egotiation failures

Discovery is the call that establishes the version, so get_adcp_capabilities
now goes out without adcp_version / adcp_major_version for every client pin,
not only for a preview one (#3856). A strict AdCP 3.0 seller that refuses a
versioned discovery call no longer fails discovery from a GA buyer. When the
unpinned answer lists the client's exact release but echoes another one, the
client re-probes once at its pin. An explicit envelope (versionEnvelope:
'auto') still sends the versioned probe and is not retried.

A 408/425/429/500/502/503/504 answer to the MCP client's negotiated connect
is a transport failure, not a negotiation result (#3858). The MCP error is
rethrown unchanged (code, name, status) and marked transient/retryable with
retryAfterMs. isTransientMCPNegotiationFailure() matches it without
instanceof. Failed task results carry MCPNegotiationTransportError as
errorInstance, and MCP endpoint discovery throws it instead of blaming
agent_uri. The root entry re-exports MCPSdkError, MCPSdkHttpError,
MCPSdkErrorCode and MCPStreamableHTTPError.

Closes #3856
Closes #3858

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The internal capability probe now goes out unpinned for every client pin, and
an unpinned push_notification_config falls back to the pre-3.1 shape with no
application-layer registration. The probe is a synchronous read sent before
the client knows the seller's release, so it carries no webhook, as preview
probes already did. An explicitly pinned probe keeps the caller's webhook
policy.

Tests that asserted a pinned probe (its webhook registration, the
pinned-then-unpinned retry, a major-only first request) now assert the
version-neutral probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lass re-exports

Review follow-ups:

- Re-probe condition: negotiate from the unpinned answer's
  supported_versions and re-probe at the negotiated release whenever it
  differs from the release the seller echoed. A 3.3 client and a seller
  listing ['3.2', '4.0'] keep the 3.2 answer, never the 4.0 one; a 3.1
  client and ['3.0', '3.2', '3.3'] get the 3.0 answer (major-only), as in
  17.0. Still at most two calls; a failed re-probe keeps the unpinned
  answer.
- Drop the MCPSdkError / MCPSdkHttpError / MCPSdkErrorCode /
  MCPStreamableHTTPError re-exports. @modelcontextprotocol/client brands
  its errors, so instanceof works across copies.
- getAdcpCapabilities JSDoc, migration guide and changeset describe the
  unversioned first discovery call and the possible second, pinned one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bokelley
bokelley merged commit 4e9b40d into main Dec 5, 2026
41 checks passed
@bokelley
bokelley deleted the fix/version-neutral-discovery-and-negotiation-errors branch December 5, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant