38a74e3911
现象:某轮 LLM 返回空(余额不足/失败/降级)→ 空 assistant 消息被写进会话历史 → 此后该 session 每次请求都带一条空 content 的 assistant 消息 → DeepSeek 400 "Invalid assistant message: content or tool_calls must be set" → 又空 → 又写空 → 自我循环毒化。 - Fix A(断源):orchestrator.memorize 对空答复直接 return,不落历史(失败的一轮不留痕)。 - Fix B(兜底):buildMessages 发送前剔除 content 与 tool_calls 均空的历史消息, 防御任何来源的脏历史(含存量)。 验证:清理被污染的 default 会话后恢复正常;新逻辑下空答复不再写入。dispatcher build+vet+test 全绿。 注:诊断中发现激活模型 deepseek-v4-pro 是推理模型(答案在 reasoning_content,content 为空), 已在管理端切回 deepseek-chat。仍待办:LLM 调用失败应暴露为 failed 而非 done-空输出。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>