# ❌ 错误:函数写在 from __future__ 之前 def _ensure_system_first(messages): ... from __future__ import annotations # SyntaxError! # ❌ 错误:夹在别的 import 与 future 之间 import json def _ensure_system_first(messages): ... from __future__ import annotations # SyntaxError! # ✅ 正确:所有新增函数都在 from __future__ 之后 from __future__ import annotations import json def _ensure_system_first(messages): ...