René's URL Explorer Experiment


Title: fix(types): codegen multi-emission of Creative/Package/etc. breaks Sequence covariant override on required response fields · Issue #642 · adcontextprotocol/adcp-client-python · GitHub

Open Graph Title: fix(types): codegen multi-emission of Creative/Package/etc. breaks Sequence covariant override on required response fields · Issue #642 · adcontextprotocol/adcp-client-python

X Title: fix(types): codegen multi-emission of Creative/Package/etc. breaks Sequence covariant override on required response fields · Issue #642 · adcontextprotocol/adcp-client-python

Description: Problem datamodel-codegen emits subordinate types (`Creative`, `Package`, `MediaBuyDelivery`, etc.) once per response file. The public alias in `adcp.types` resolves to one specific emission, but the response type's field references a di...

Open Graph Description: Problem datamodel-codegen emits subordinate types (`Creative`, `Package`, `MediaBuyDelivery`, etc.) once per response file. The public alias in `adcp.types` resolves to one specific emission, but t...

X Description: Problem datamodel-codegen emits subordinate types (`Creative`, `Package`, `MediaBuyDelivery`, etc.) once per response file. The public alias in `adcp.types` resolves to one specific emission, but t...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix(types): codegen multi-emission of Creative/Package/etc. breaks Sequence covariant override on required response fields","articleBody":"## Problem\n\ndatamodel-codegen emits subordinate types (\\`Creative\\`, \\`Package\\`, \\`MediaBuyDelivery\\`, etc.) **once per response file**. The public alias in \\`adcp.types\\` resolves to one specific emission, but the response type's field references a *different* local emission with the same name.\n\nExample:\n\n\\`\\`\\`python\nfrom adcp.types import Creative\n# → adcp.types.generated_poc.creative.get_creative_delivery_response.Creative\n\nfrom adcp.types.generated_poc.creative.list_creatives_response import (\n    ListCreativesResponse,\n)\n# ListCreativesResponse.creatives: Sequence[Creative]\n# ↑ this Creative is adcp.types.generated_poc.creative.list_creatives_response.Creative\n#   — a DIFFERENT class with the same name\n\\`\\`\\`\n\nThese two \\`Creative\\` classes are nominally identical but type-distinct from mypy's perspective. So an adopter pattern:\n\n\\`\\`\\`python\nfrom adcp.types import Creative\n\nclass _Ext(Creative):\n    extra: str | None = Field(default=None, exclude=True)\n\nclass _ExtListResp(ListCreativesResponse):\n    creatives: list[_Ext]  # mypy [assignment] — type-identity mismatch\n\\`\\`\\`\n\n…fails under mypy --strict regardless of #624's Sequence widening, because \\`_Ext\\` is a subclass of one \\`Creative\\` and the parent expects a different one.\n\n## Affected response types (likely incomplete)\n\nEach of these has a field whose element type is locally re-emitted rather than imported from the canonical module:\n\n- \\`ListCreativesResponse.creatives\\` → \\`Creative\\`\n- \\`GetCreativeDeliveryResponse.creatives\\` → \\`Creative\\`\n- \\`GetMediaBuyDeliveryResponse.media_buy_deliveries\\` → \\`MediaBuyDelivery\\`\n- \\`GetMediaBuysResponse.media_buys\\` → \\`MediaBuy\\`\n- \\`GetSignalsResponse.signals\\` → \\`Signal\\`\n\n(These are the same response types where #624's Sequence widening produces incomplete coverage — the widening is necessary but not sufficient because of this codegen-side issue.)\n\n## Proposed fix\n\nTwo paths:\n\n**A) Codegen-side: prefer cross-file import over local re-emission.** When datamodel-codegen sees that \\`Creative\\` is already defined in a sibling module (e.g. \\`creative/creative_item.py\\` or \\`core/creative.py\\`), import it rather than re-emit. Same shape, same type identity, override compatibility restored.\n\n**B) Post-processor: rewrite all \\`X\\` references in a generated file to import from the canonical module.** A new function in \\`scripts/post_generate_fixes.py\\` that, for each multi-emitted type on an allowlist, replaces local class definitions with \\`from .canonical_module import X\\` and keeps the rest of the file pointing at the imported reference.\n\nApproach A is structurally cleaner; approach B is more contained and safer if the canonical-module mapping is unambiguous.\n\n## Companion to #624\n\nThis issue tracks the type-identity half of the adopter override-pattern friction. #624 (Sequence widening) is required first — without it, even cases where the type identity *is* correct would still hit list-invariance \\`[assignment]\\` errors. After both land, the full Critical Pattern #1 override should typecheck cleanly under mypy --strict with zero \\`# type: ignore\\` lines.\n\n## How surfaced\n\nWhile extending the regression test for #624 to cover required-list overrides (\\`tests/type_checks/extend_response_with_sequence.py\\`), the override of \\`ListCreativesResponse.creatives: list[_InternalCreative]\\` still failed with \\`[assignment]\\` even after Sequence widening. Spike traced the failure to type identity, not variance.\n\n## Related\n\n- #624 — Sequence covariant widening (lands first)\n- salesagent's existing \\`# type: ignore[assignment]\\` lines on \\`creatives\\` overrides remain warranted until this lands","author":{"url":"https://github.com/bokelley","@type":"Person","name":"bokelley"},"datePublished":"2026-05-10T16:58:55Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/642"}

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:9eb85e5e-ca72-64e2-ffe0-1df40ed0076d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBB1A:1EC9BC:9B9576:C7A90A:6B00F19B
html-safe-noncee7edd7da8be813917bde155eb3bb949b39d376e66280848e7497761196081fd5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjFBOjFFQzlCQzo5Qjk1NzY6QzdBOTBBOjZCMDBGMTlCIiwidmlzaXRvcl9pZCI6Ijg2MjY0MDY4MTYxMjI3Mjg4NTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacfc1440b6d8d4b31bfff0a46635f1408e1d30e2b27909b2ca745006d6820637fc
hovercard-subject-tagissue:4416241302
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/642/issue_layout
twitter:imagehttps://opengraph.githubassets.com/70f494e96cf59784c04c1a6e486c5ce6e6da7a073db8e22b20c7f3d872157bf9/adcontextprotocol/adcp-client-python/issues/642
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/70f494e96cf59784c04c1a6e486c5ce6e6da7a073db8e22b20c7f3d872157bf9/adcontextprotocol/adcp-client-python/issues/642
og:image:altProblem datamodel-codegen emits subordinate types (`Creative`, `Package`, `MediaBuyDelivery`, etc.) once per response file. The public alias in `adcp.types` resolves to one specific emission, but t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebokelley
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/adcontextprotocol/adcp-client-python/issues/642#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fadcontextprotocol%2Fadcp-client-python%2Fissues%2F642
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%2F642
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/642
Reloadhttps://github.com/adcontextprotocol/adcp-client-python/issues/642
Reloadhttps://github.com/adcontextprotocol/adcp-client-python/issues/642
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/642
New issuehttps://github.com/login?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/642
fix(types): codegen multi-emission of Creative/Package/etc. breaks Sequence covariant override on required response fieldshttps://github.com/adcontextprotocol/adcp-client-python/issues/642#top
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 10, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/642#issue-4416241302
#624https://github.com/adcontextprotocol/adcp-client-python/issues/624
#624https://github.com/adcontextprotocol/adcp-client-python/issues/624
#624https://github.com/adcontextprotocol/adcp-client-python/issues/624
#624https://github.com/adcontextprotocol/adcp-client-python/issues/624
#1https://github.com/adcontextprotocol/adcp-client-python/pull/1
#624https://github.com/adcontextprotocol/adcp-client-python/issues/624
feat(types): adopter inheritance pattern triggers ~50 type: ignore[assignment] #624https://github.com/adcontextprotocol/adcp-client-python/issues/624
bokelleyhttps://github.com/bokelley
on May 10, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/642#event-25356182002
fix(types): address pre-merge review on #624 — bound regex to class, …https://github.com/adcontextprotocol/adcp-client-python/commit/cd018adc2f030160d700cdfad7a721f905d77a4a
#624https://github.com/adcontextprotocol/adcp-client-python/issues/624
cd018adhttps://github.com/adcontextprotocol/adcp-client-python/commit/cd018adc2f030160d700cdfad7a721f905d77a4a
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 10, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/642#event-25356190731
https://github.com/bokelley
bokelleyhttps://github.com/bokelley
on May 10, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/642#issuecomment-4415840540
feat(types): adopter inheritance pattern triggers ~50 type: ignore[assignment] #624https://github.com/adcontextprotocol/adcp-client-python/issues/624
feat(types): adopter inheritance pattern triggers ~50 type: ignore[assignment] #624https://github.com/adcontextprotocol/adcp-client-python/issues/624
feat(types): Sequence[T] on response-only list fields for covariant adoption #635https://github.com/adcontextprotocol/adcp-client-python/pull/635
feat(types): widen extension-point list[X] to Sequence[X] (#624) #640https://github.com/adcontextprotocol/adcp-client-python/pull/640
#624https://github.com/adcontextprotocol/adcp-client-python/issues/624
#642https://github.com/adcontextprotocol/adcp-client-python/issues/642
#640https://github.com/adcontextprotocol/adcp-client-python/pull/640
#624https://github.com/adcontextprotocol/adcp-client-python/issues/624
https://claude.ai/code/session_01XgqM4ULaBn2Cx94tPA5qEthttps://claude.ai/code/session_01XgqM4ULaBn2Cx94tPA5qEt
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 10, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/642#event-25356193673
bokelleyhttps://github.com/bokelley
on May 10, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/642#event-25356234762
feat(types): widen extension-point list[X] to Sequence[X] (#624) (#640)https://github.com/adcontextprotocol/adcp-client-python/commit/96ccfd48da0a1d1f86a23119b2313a0fe5338416
#624https://github.com/adcontextprotocol/adcp-client-python/issues/624
#640https://github.com/adcontextprotocol/adcp-client-python/pull/640
96ccfd4https://github.com/adcontextprotocol/adcp-client-python/commit/96ccfd48da0a1d1f86a23119b2313a0fe5338416
https://github.com/bokelley
bokelleyhttps://github.com/bokelley
on May 10, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/642#issuecomment-4415851504
bokelleyhttps://github.com/bokelley
not plannedhttps://github.com/adcontextprotocol/adcp-client-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on May 10, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/642#event-25356249409
bokelleyhttps://github.com/bokelley
on May 13, 2026https://github.com/adcontextprotocol/adcp-client-python/issues/642#event-25485760472
docs: response-extension import path guidance for context-specific sc…https://github.com/adcontextprotocol/adcp-client-python/commit/8f6f9e759fbf065c6859efb7990325da00f8ec97
8f6f9e7https://github.com/adcontextprotocol/adcp-client-python/commit/8f6f9e759fbf065c6859efb7990325da00f8ec97
docs: response-extension import path guidance for context-specific sc…https://github.com/adcontextprotocol/adcp-client-python/commit/61fb835fb7c141ddec95b6e890eb804024b21edb
61fb835https://github.com/adcontextprotocol/adcp-client-python/commit/61fb835fb7c141ddec95b6e890eb804024b21edb
Sign up for freehttps://github.com/signup?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/642
Sign in to commenthttps://github.com/login?return_to=https://github.com/adcontextprotocol/adcp-client-python/issues/642
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.