René's URL Explorer Experiment


Title: feat(server): ship built-in spec_compat_hooks() for pre-v3 / pre-4.4 buyer compatibility · Issue #646 · adcontextprotocol/adcp-client-python · GitHub

Open Graph Title: feat(server): ship built-in spec_compat_hooks() for pre-v3 / pre-4.4 buyer compatibility · Issue #646 · adcontextprotocol/adcp-client-python

X Title: feat(server): ship built-in spec_compat_hooks() for pre-v3 / pre-4.4 buyer compatibility · Issue #646 · adcontextprotocol/adcp-client-python

Description: Problem adcp 5.0 (PR #629, closes #614) shipped serve(pre_validation_hooks=...) — the mechanism is great, but every Python adopter that accepts pre-v3 / pre-4.4 buyers needs the same handful of spec-mandated default + shape-migration hoo...

Open Graph Description: Problem adcp 5.0 (PR #629, closes #614) shipped serve(pre_validation_hooks=...) — the mechanism is great, but every Python adopter that accepts pre-v3 / pre-4.4 buyers needs the same handful of spe...

X Description: Problem adcp 5.0 (PR #629, closes #614) shipped serve(pre_validation_hooks=...) — the mechanism is great, but every Python adopter that accepts pre-v3 / pre-4.4 buyers needs the same handful of spe...

Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/646

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(server): ship built-in spec_compat_hooks() for pre-v3 / pre-4.4 buyer compatibility","articleBody":"## Problem\n\nadcp 5.0 (PR #629, closes #614) shipped `serve(pre_validation_hooks=...)` — the mechanism is great, but every Python adopter that accepts pre-v3 / pre-4.4 buyers needs the same handful of spec-mandated default + shape-migration hooks. Each adopter writes (and maintains) the same code.\n\nIn [bokelley/salesagent](https://github.com/bokelley/salesagent) we just migrated our 273-LOC `SpecDefaultsMiddleware` to ~150 LOC of `pre_validation_hooks`. Looking at what we wrote, **none of it is salesagent-specific** — every line is a universal compatibility shim:\n\n| Hook | What it does | Why universal |\n|---|---|---|\n| `get_products.buying_mode='brief'` | Default the field when omitted | Spec says: *\"Sellers receiving requests from pre-v3 clients without buying_mode SHOULD default to 'brief'.\"* Every seller, by the spec text. |\n| `sync_creatives.creatives[*].format_id` string → `{agent_url, id}` | Wrap bare string format_id as the structured 4.4 reference | adcp 4.4 changed format_id from string to structured. Pre-4.4 buyers send a string; any seller accepting them needs the same wrap. The default `agent_url` is the canonical `https://creative.adcontextprotocol.org/` registry. |\n| `sync_creatives.creatives[*].assets[*].asset_type` inference | Infer the missing `asset_type` from the asset key (`image`/`video`/...) or from `content`/`url`/`width+height` presence | adcp 4.4 added explicit `asset_type` to make `AssetVariant` discriminated; pre-4.4 buyers used the key as the implicit type. Universal compat. |\n| `sync_creatives.creatives[*].assets[*]` image → url demote | When `asset_type='image'` but `width`/`height` missing, demote to `url` variant | The strict 4.4 image variant requires dims; pre-4.4 buyers frequently send image-shaped URLs without them. Universal compat. |\n\nWe're carrying this code as if it were adopter logic. It's not — it's the SDK's compat layer for migrating buyers across spec major versions.\n\n## Proposed shape\n\nShip a built-in `spec_compat_hooks()` (or similarly named) in `adcp.server` that adopters can wire into `pre_validation_hooks`:\n\n```python\nfrom adcp.server import spec_compat_hooks, serve\n\n# Standalone:\nserve(router, pre_validation_hooks=spec_compat_hooks())\n\n# Combined with adopter-specific hooks:\nserve(router, pre_validation_hooks={\n    **spec_compat_hooks(),\n    \"create_media_buy\": my_custom_hook,\n})\n\n# Selective opt-out:\nserve(router, pre_validation_hooks=spec_compat_hooks(exclude={\"sync_creatives\"}))\n```\n\nOpt-in by design — adopters who want strict-4.4 rejection of pre-v3 / pre-4.4 buyers leave it off. Adopters who accept the long tail of legacy clients (most production sellers) wire it once and forget about it.\n\n## What's in / out of scope\n\n**In:** The four hooks above. Each maps to a spec versioning event (pre-v3 `buying_mode`, pre-4.4 `format_id` shape, pre-4.4 `asset_type` discriminator, pre-4.4 image dim requirement).\n\n**Out:** Adopter-specific defaulting (e.g. salesagent's removed `account: auth-chain` placeholder — that was an adopter bug, not a spec migration). Adopters write those themselves via the same `pre_validation_hooks` mechanism, layered on top.\n\n## Why this matters beyond us\n\nThese hooks are *exactly* the kind of glue every adopter has to write when migrating from a pre-4.4 SDK to a 5.0 SDK. Shipping them in the SDK:\n\n1. Saves each adopter ~150 LOC of mechanical-but-spec-sensitive code.\n2. Centralises the canonical agent_url (`https://creative.adcontextprotocol.org/`), the asset-type inference table, the image-dim demotion rule — adopters who roll their own will silently diverge.\n3. Provides a single PR target when the spec adds the next pre-major-version compat shim (adcp 6.0 → 7.0 someday) instead of every adopter re-discovering it.\n\n## Source\n\nOur [core/spec_default_hooks.py](https://github.com/bokelley/salesagent/blob/main/core/spec_default_hooks.py) is what we just wrote — happy to send the contents as a starter PR if there's interest in shipping it directly. The file is intentionally pure-Python (no transport / framework deps) so dropping it into `adcp.server` should be drop-in.\n\n## Related\n\n- #614 / PR #629 — the `pre_validation_hooks` mechanism this builds on.\n- #623 — closed, established the spec-correctness boundary: `account` and `idempotency_key` are unconditionally required (NOT spec-migration defaults; adopters must enforce them). This issue stays on the right side of that boundary — only proposing hooks for fields the spec explicitly marks as defaultable or as shape-migration cases.\n","author":{"url":"https://github.com/bokelley","@type":"Person","name":"bokelley"},"datePublished":"2026-05-11T06:17:22Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/646"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1bf1ad66-906e-c0fc-1d65-73734cb1da21
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC9A6:3D97C8:26371B9:32E14F4:6B01A521
html-safe-nonced0e75d7c3acf6e0c8ca55fd6d6ae56f32ba7a6de20cb323a6736c6c7aa724f59
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUE2OjNEOTdDODoyNjM3MUI5OjMyRTE0RjQ6NkIwMUE1MjEiLCJ2aXNpdG9yX2lkIjoiNzAxODE4MjExMjAwNDEyMTg4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0b4ed0726b20c5dec8036b69cebe3043c818af869903c33505bafec47ad8de57
hovercard-subject-tagissue:4418498421
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/adcontextprotocol/adcp-client-python/646/issue_layout
twitter:imagehttps://opengraph.githubassets.com/780b547a0cf55ced3121796621bbbb98f802ce2783f26190e71cef3c3b8edce0/adcontextprotocol/adcp-client-python/issues/646
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/780b547a0cf55ced3121796621bbbb98f802ce2783f26190e71cef3c3b8edce0/adcontextprotocol/adcp-client-python/issues/646
og:image:altProblem adcp 5.0 (PR #629, closes #614) shipped serve(pre_validation_hooks=...) — the mechanism is great, but every Python adopter that accepts pre-v3 / pre-4.4 buyers needs the same handful of spe...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebokelley
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/adcontextprotocol/adcp-client-python git https://github.com/adcontextprotocol/adcp-client-python.git
octolytics-dimension-user_id221690821
octolytics-dimension-user_loginadcontextprotocol
octolytics-dimension-repository_id1090305973
octolytics-dimension-repository_nwoadcontextprotocol/adcp-client-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1090305973
octolytics-dimension-repository_network_root_nwoadcontextprotocol/adcp-client-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/adcontextprotocol/adcp-client-python/issues/646#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fadcontextprotocol%2Fadcp-client-python%2Fissues%2F646
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fadcontextprotocol%2Fadcp-client-python%2Fissues%2F646
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=adcontextprotocol%2Fadcp-client-python
Reloadhttps://github.com/adcontextprotocol/adcp-client-python/issues/646
Reloadhttps://github.com/adcontextprotocol/adcp-client-python/issues/646
Reloadhttps://github.com/adcontextprotocol/adcp-client-python/issues/646
adcontextprotocolhttps://github.com/adcontextprotocol
adcp-client-pythonhttps://github.com/adcontextprotocol/adcp-client-python
Codehttps://github.com/adcontextprotocol/adcp-client-python
Issues44 (44)https://github.com/adcontextprotocol/adcp-client-python/issues
Pull requests13 (13)https://github.com/adcontextprotocol/adcp-client-python/pulls
Actionshttps://github.com/adcontextprotocol/adcp-client-python/actions
Projectshttps://github.com/adcontextprotocol/adcp-client-python/projects
Security and qualityhttps://github.com/adcontextprotocol/adcp-client-python/security
Insightshttps://github.com/adcontextprotocol/adcp-client-python/insights
https://github.com/adcontextprotocol/adcp-client-python
New issuehttps://github.com/login?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/646
New issuehttps://github.com/login?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/646
#648https://github.com/adcontextprotocol/adcp-client-python/pull/648
feat(server): ship built-in spec_compat_hooks() for pre-v3 / pre-4.4 buyer compatibilityhttps://github.com/adcontextprotocol/adcp-client-python/issues/646#top
#648https://github.com/adcontextprotocol/adcp-client-python/pull/648
claude-triagedhttps://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaged%22
https://github.com/bokelley
bokelleyhttps://github.com/bokelley
on May 11, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/646#issue-4418498421
#629https://github.com/adcontextprotocol/adcp-client-python/pull/629
#614https://github.com/adcontextprotocol/adcp-client-python/issues/614
bokelley/salesagenthttps://github.com/bokelley/salesagent
core/spec_default_hooks.pyhttps://github.com/bokelley/salesagent/blob/main/core/spec_default_hooks.py
feat(server): pre-validation request hook / spec-default registry #614https://github.com/adcontextprotocol/adcp-client-python/issues/614
feat(server): pre-validation request hook for spec-default injection (#614) #629https://github.com/adcontextprotocol/adcp-client-python/pull/629
Typed dispatcher rejects valid request when account is omitted on auth-resolved tools #623https://github.com/adcontextprotocol/adcp-client-python/issues/623
bokelleyhttps://github.com/bokelley
claude-triagingTriage routine is actively working on this issue (1-3 min)https://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaging%22
on May 11, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/646#event-25368189443
https://github.com/bokelley
bokelleyhttps://github.com/bokelley
on May 11, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/646#issuecomment-4418172606
#648https://github.com/adcontextprotocol/adcp-client-python/pull/648
https://claude.ai/code/session_01FmPS6TP29PNk9PuedFDTbmhttps://claude.ai/code/session_01FmPS6TP29PNk9PuedFDTbm
Claude Codehttps://claude.ai/code
bokelleyhttps://github.com/bokelley
claude-triagedhttps://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaged%22
claude-triagingTriage routine is actively working on this issue (1-3 min)https://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaging%22
on May 11, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/646#event-25368983672
bokelleyhttps://github.com/bokelley
completedhttps://github.com/adcontextprotocol/adcp-client-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#648https://github.com/adcontextprotocol/adcp-client-python/pull/648
on May 11, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/646#event-25369980678
bokelleyhttps://github.com/bokelley
on May 11, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/646#event-25369980754
feat(server): add spec_compat_hooks() for pre-v3 / pre-4.4 buyer comp…https://github.com/adcontextprotocol/adcp-client-python/commit/30690e54a0298960489e8595c3f5480a401ad00f
https://docs.github.com/articles/closing-issues-via-commit-messages
30690e5https://github.com/adcontextprotocol/adcp-client-python/commit/30690e54a0298960489e8595c3f5480a401ad00f
Sign up for freehttps://github.com/signup?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/646
Sign in to commenthttps://github.com/login?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/646
claude-triagedhttps://github.com/adcontextprotocol/adcp-client-python/issues?q=state%3Aopen%20label%3A%22claude-triaged%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.