Kimi K2.5 thinking mode: 400 error “reasoning_content is missing in assistant tool call message” during multi-round tool loops

Diagnosis

When Kimi K2.5 runs with thinking mode (temperature=1.0, top_p=0.95), API responses include reasoning_content on assistant messages. In multi-round tool-use loops, the assistant message is reconstructed as a dict with only role/content/tool_calls — dropping reasoning_content. On the next API call, Moonshot rejects the conversation history because thinking mode requires reasoning_content on all assistant messages.

Fix

Preserve reasoning_content when building assistant message dicts: reasoning = getattr(msg, "reasoning_content", None) → if present, add assistant_msg["reasoning_content"] = reasoning. Applied in /opt/infra/cios-notify/ai/client.py _tool_loop(). Gotcha: failure only on round 2+ of tool loops (first call has no prior assistant messages). The APIError catch returns a generic fallback, hiding the real cause — check logs for the 400 body.