Skip to content

fix(client): preserve canonical format options in get_products - #1006

Draft
bokelley wants to merge 1 commit into
mainfrom
claude/issue-1005-preserve-canonical-products
Draft

fix(client): preserve canonical format options in get_products#1006
bokelley wants to merge 1 commit into
mainfrom
claude/issue-1005-preserve-canonical-products

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Closes #1005.

What changed

  • Parse get_products responses through the canonical GetProductsResponse model first.
  • Preserve the existing legacy response projection as a fallback when canonical validation fails.
  • Cache canonical product routes and attach an empty projection-diagnostics envelope for direct canonical responses.
  • Add regression coverage for canonical-only products and for the legacy format_ids fallback.

Root cause

_canonicalize_get_products_result() parsed every response through LegacyGetProductsResponse before projection. The generated legacy ProductFormatDeclaration does not declare format_kind or params, so Pydantic discarded those canonical fields before project_legacy_product() saw them. Valid canonical-only products were then omitted with FORMAT_PROJECTION_FAILED diagnostics.

Impact

Python buyers using the primary ADCPClient.get_products() API now retain canonical format_options. Legacy-only sellers continue through the compatibility projector.

Validation

  • make test: 6,200 passed, 41 skipped, 1 xfailed; 84.18% coverage
  • make typecheck-all: passed (932 SDK source files plus strict adopter fixtures)
  • make lint: passed
  • File-scoped pre-commit suite: passed, including Bandit
  • Live regression against Embedded Sales Agent:
    • released v7.0.0-rc: 2 wire products became 0 with four projection errors
    • this branch: both products and canonical image declarations were preserved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(client): preserve canonical format options in get_products

1 participant