[bug] MindIE drops structured ToolMessage content before the next model turn
Author: xbzz1018Created Sep 28, 2026Updated Sep 28, 2026
Labelsneeds-triage
Problem
On upstream main at 712a11c, the MindIE adapter drops structured ToolMessage content before the next LLM request. _fix_messages only keeps string and type=text blocks, so a JSON tool result becomes an empty <tool_response> and the model cannot see the tool output.
Reproduction
from langchain_core.messages import ToolMessage
from deerflow.models.mindie_provider import _fix_messages
msg = ToolMessage(
content=[{"type": "json", "json": {"temperature": 21, "unit": "C"}}],
tool_call_id="call_structured",
)
result = _fix_messages([msg])The current result is:
<tool_response>
</tool_response>Expected behavior
Structured tool result blocks should remain visible in the MindIE tool response sent to the next model turn, while the existing XML escaping remains intact.
Evidence
- Regression test on
712a11c: failed because"temperature": 21was absent from the response. - The same test passes after the fix.
- This is request-side MindIE normalization; it is separate from client event serialization (#1167), token accounting (#5192), and XML breakout escaping (#4253).
Scope
Only MindIE ToolMessage serialization and regression coverage are needed. No provider network call or API key is required.
Environment
- OS: Windows
- Runtime: Python unit tests with offline LangChain message objects
- Reproduction commit:
712a11c
Source: bytedance/deer-flow