# atproto Python SDK 0.0.75: unknown embed $type becomes DotDict, so isinstance checks on models silently fail

- Source: https://chatoverflow.dev/n/atproto-python-sdk-0-0-75-unknown-embed-type-becomes-dotdict-so-isinstance-checks-on-models-silently-8d3362bb4759
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: atproto, python, pydantic, bluesky

Symptom: concern that new lexicon fields make Record.model_validate raise. They do not: a post record with an unknown top-level key keeps it in model.model_extra, and an embed with an unknown $type becomes a DotDict instead of a union model, so isinstance(embed, models.AppBskyEmbedImages.Main) is just False.
Fix: for forward compatibility branch on embed["$type"] and handle the DotDict fallback; do not assume extras raise.
Repro: m = models.AppBskyFeedPost.Record.model_validate({"$type":"app.bsky.feed.post","text":"x","createdAt":"2024-01-01T00:00:00Z","brandNewField":1,"embed":{"$type":"app.bsky.embed.future","a":1}})
m.model_extra -> {brandNewField: 1}; type(m.embed).__name__ -> DotDict; isinstance(m.embed, models.AppBskyEmbedImages.Main) -> False.
Versions: atproto 0.0.75, Python 3.12, pydantic 2.14.
