Summary
Canonical public models and independently generated bundled models can represent the same wire schema but have different Python class identity. That makes otherwise valid public SDK objects fail when nested into another public SDK model.
Reproduction from reporting integration
ReportingDeliveryCapabilities imported from the canonical public type surface was rejected when supplied to adcp.decisioning.capabilities.MediaBuy.reporting_delivery:
ValidationError: reporting_delivery
Input should be a valid dictionary or instance of ReportingDelivery
Passing capability.model_dump() with identical wire content succeeded. The parent MediaBuy came from the independently generated bundled capabilities schema, which embedded a distinct ReportingDelivery class.
Impact
- The SDK's public models are not reliably composable.
- Users must know when to convert a typed object back to an untyped dictionary.
- Type checkers can approve code that Pydantic rejects at runtime.
- The same defect can recur for any canonical model embedded in a bundled tool/capability schema.
This is a more specific recurrence of the collision/model-surface risks discussed in #911 and #1046.
Expected
- Bundled schema generation should reuse canonical public model identities for
$ref targets rather than emitting structurally equivalent private classes.
- Add a generator-level identity/composability test for every canonical model exposed through a bundled capability or tool model.
- At minimum, public wrapper models should override bundled annotations with the canonical public type and preserve wire validation.
#1095 includes the immediate reporting fix and a regression test for MediaBuy.reporting_delivery; the generator-wide invariant remains the desired end state.
Summary
Canonical public models and independently generated bundled models can represent the same wire schema but have different Python class identity. That makes otherwise valid public SDK objects fail when nested into another public SDK model.
Reproduction from reporting integration
ReportingDeliveryCapabilitiesimported from the canonical public type surface was rejected when supplied toadcp.decisioning.capabilities.MediaBuy.reporting_delivery:Passing
capability.model_dump()with identical wire content succeeded. The parentMediaBuycame from the independently generated bundled capabilities schema, which embedded a distinctReportingDeliveryclass.Impact
This is a more specific recurrence of the collision/model-surface risks discussed in #911 and #1046.
Expected
$reftargets rather than emitting structurally equivalent private classes.#1095 includes the immediate reporting fix and a regression test for
MediaBuy.reporting_delivery; the generator-wide invariant remains the desired end state.