Skip to content

coerce_legacy_assets doesn't know display_tag, and normalize_url keeps surrounding whitespace #1624

Closed

Description

@bokelley

Two small legacy-compat gaps found while moving the Embedded Sales Agent onto SDK helpers (adcp 9.1.0).

1. coerce_legacy_assets doesn't know the AdCP 3.2 display_tag asset type

from adcp.compat.legacy import coerce_legacy_assets

assets = {"display_tag": {"content": "<script src='https://ads.example/tag.js'></script>"}}
print(coerce_legacy_assets(assets))
{'display_tag': {'content': "<script src='https://ads.example/tag.js'></script>", 'asset_type': 'text'}}

An untyped asset under the display_tag key is inferred from its other keys, as text here, or as url/image when it carries a url. It should be inferred as display_tag. ESA keeps a one-rule shim in front of coerce_legacy_assets for this.

2. normalize_url keeps surrounding whitespace

from adcp.adagents import normalize_url

print(repr(normalize_url(" https://interchange.io ")))
print(repr(normalize_url("https://interchange.io")))
'interchange.io '
'interchange.io'

An adagents.json entry whose url has stray whitespace doesn't match its agent. Stripping before normalizing would match the intended URL.

Activity

  1. added a commit that references this issue on Oct 26, 2026
    88cf04a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions