#2847·smolagents

SafeSerializer 在一个普通字典上发生损坏/崩溃,该字典的 `__type__` 关键字与内部类型标签发生冲突

作者: VANDRANKI创建于 2026年9月25日更新于 2026年9月25日

The problem: nothing stops an ordinary user dict from itself containing a key literally named `"__type__"`. If that dict passes through `SafeSerializer.dumps()`/`.loads()`, the round trip either raises an unrelated, confusing exception, or silently returns a completely different object than what was sent - depending only on what string happens to be under that key.

内容来源: huggingface/smolagents