mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 01:40:15 +08:00
PR #7202 added empty-assistant filtering in `_query` so strict providers (Moonshot, etc.) wouldn't 400 on history with blank assistant entries. The streaming sibling `_query_stream` was never updated, so DeepSeek Reasoner — which returns reasoning only during tool calls, leaving serialized content as `""` — blew up with `Invalid assistant message: content or tool_calls must be set` on the next turn. Hoisted the filter into a `_sanitize_assistant_messages` helper and called it from both paths. Also widened the empty check to cover `content == []`, which the original filter missed and which shows up with providers that emit content as a list of parts.
55 KiB
55 KiB