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
Model-derived format references hash a normalized agent_url into a different migrated option ID #1384
migrated_format_option_id() (src/adcp/canonical_formats/projection.py) hashes str(ref.agent_url) exactly as received, which is the cross-SDK algorithm (see tests/fixtures/canonical/typescript-13.0.0-rc.3-option-ids.json).
A format reference that has passed through a generated model carries a Pydantic AnyUrl, which normalizes https://creative.adcontextprotocol.org to https://creative.adcontextprotocol.org/. The same wire format therefore produces two different option IDs depending on whether it was hashed from the wire mapping or from a model:
wire mapping → migrated_63b8bee2… (normative)
model-derived reference → migrated_475375ec…
This already happens on main in project_legacy_product() (it dumps a LegacyProduct model before projecting), and #1376 widens coerce_format_id to accept model-derived parents, so more callers can reach it. #1376 documents the caveat on the function.
Canonicalizing the URL before hashing is not a fix: it would change IDs already derived from existing wire inputs and break parity with the TypeScript fixtures.
Proposed fix: make the generated format-reference agent_url preserve the wire string (e.g. annotate it as a URL-validated str in codegen rather than AnyUrl), so a model round-trip keeps the bytes that the ID algorithm hashes. Acceptance: a reference built from the wire mapping and one taken off a validated model produce the same migrated_… ID, and the TypeScript parity fixture still passes.
Activity
fix(codegen): keep the format-reference agent_url as the wire string (a…
fix(types): make every Legacy name the generated class, one per respo…
refactor(codegen)!: make the generated domain tree the one public typ…
fix(types): keep wire bytes on parsed URLs, datetimes, UUIDs and emai…
fix(types): keep wire bytes on parsed URLs, datetimes, UUIDs and emai…
test(branches, wire-url): open the union through _branch_models and s…