You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: make server dispatch automatically adapt responses by requested AdCP version #868
After #855, the Python SDK exposes resolve_requested_adcp_version(), which is useful, but seller applications still have to wire the versioning contract manually inside tool handlers.
That leaves generic protocol behavior in every adopter:
Resolve the buyer's requested AdCP release from request payload fields.
Default omitted/legacy buyers to the correct 3.0 compatibility behavior.
Convert unsupported versions into a protocol error.
Project media-buy responses into the requested release shape.
Keep MCP and A2A behavior consistent.
This should be automatic in the SDK/server dispatch layer. Seller handlers should be able to return the canonical current response model, and the server should serialize the correct wire shape for the buyer.
Current adopter-side code
Prebid Sales Agent currently has to carry local code equivalent to:
If this stays in seller code, every adopter has to rediscover the same edge cases and keep MCP/A2A behavior aligned by hand. That is exactly the kind of SDK workaround that will fragment implementations.
Related follow-ups from the same integration pass:
Classification: Feature request Bucket(s): handlers, middleware (neither label exists in repo — flagged in run summary) Status: ready-to-implement
What the experts said:
dx-expert: real boilerplate reduction; resolved_adcp_version: str | None = None on ToolContext is the right attachment point; non-breaking additive field; cautions that sellers doing manual version projection today must remove their projection code after migration or it will be applied twice
ad-tech-protocol-expert: MCP dispatch already centralizes normalization correctly; A2A gap is confirmed — a2a_server.py never calls _normalize_response_envelope at all; spec places projection on the transport layer, not the handler; critical: None must mean "assume latest" in A2A, not collapse to the DEFAULT_UNNEGOTIATED_ADCP_VERSION = "3.0" pin that unnegotiated MCP traffic uses
My take: The dispatch already resolves wire version and normalizes MCP responses internally — the two missing pieces are (1) threading the resolved version onto ToolContext so handlers can observe it, and (2) extending the same normalization to the A2A path, which currently has none. Both are additive and the normalization is idempotent with what the MCP path already does.
Resolved on main by the server dispatch/version negotiation work. Dispatch now resolves the requested ADCP version, threads , and applies response adaptation; A2A uses the same tool-caller path with explicit major-version projection coverage in .
Correction to the close note above: resolved on main by the server dispatch/version negotiation work. Dispatch now resolves the requested ADCP version, threads ToolContext.resolved_adcp_version, and applies response adaptation; A2A uses the same tool-caller path with explicit major-version projection coverage in tests/test_a2a_server.py.
Activity
bokelley commentedon May 26, 2026
Triage
Classification: Feature request
Bucket(s): handlers, middleware (neither label exists in repo — flagged in run summary)
Status: ready-to-implement
What the experts said:
resolved_adcp_version: str | None = NoneonToolContextis the right attachment point; non-breaking additive field; cautions that sellers doing manual version projection today must remove their projection code after migration or it will be applied twicea2a_server.pynever calls_normalize_response_envelopeat all; spec places projection on the transport layer, not the handler; critical:Nonemust mean "assume latest" in A2A, not collapse to theDEFAULT_UNNEGOTIATED_ADCP_VERSION = "3.0"pin that unnegotiated MCP traffic usesMy take: The dispatch already resolves wire version and normalizes MCP responses internally — the two missing pieces are (1) threading the resolved version onto
ToolContextso handlers can observe it, and (2) extending the same normalization to the A2A path, which currently has none. Both are additive and the normalization is idempotent with what the MCP path already does.Implementation scope:
src/adcp/server/base.py— addresolved_adcp_version: str | None = NonetoToolContextsrc/adcp/server/mcp_tools.py— setctx.resolved_adcp_version = wire_versionincall_toolafter the version is resolved (~line 2307)src/adcp/server/a2a_server.py— adddetect_wire_versioncall and post-handler_normalize_response_envelope(currently absent); preserveNone = assume latest, notNone = 3.0ToolContext.resolved_adcp_versionis populated in both MCP and A2A dispatch; A2A path normalizes 3.0 shapes correctlypytest tests/,mypy src/adcp/server/,ruff check src/None-default field onToolContext; MCP normalization already runs today; A2A addition is strictly additiveRelated: #866 (MCP outputSchema validation, parallel work, not a blocker).
Triaged by Claude Code. Session: https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}
Generated by Claude Code
bokelley commentedon May 26, 2026
Resolved on main by the server dispatch/version negotiation work. Dispatch now resolves the requested ADCP version, threads , and applies response adaptation; A2A uses the same tool-caller path with explicit major-version projection coverage in .
bokelley commentedon May 26, 2026
Correction to the close note above: resolved on main by the server dispatch/version negotiation work. Dispatch now resolves the requested ADCP version, threads
ToolContext.resolved_adcp_version, and applies response adaptation; A2A uses the same tool-caller path with explicit major-version projection coverage intests/test_a2a_server.py.