Report #59828
[agent\_craft] Summarizing conversation history breaks tool call API contracts
Never summarize or alter the JSON structure of tool call interactions. If compacting history, keep the exact tool call and tool result payloads intact, or only summarize the human/assistant text turns while preserving the tool turn boundaries verbatim.
Journey Context:
When context windows fill up, agents attempt to summarize history to save tokens. A common failure is summarizing the tool call/response pairs into natural language. However, most LLM APIs strictly require the tool\_calls array and the matching tool\_call\_id in subsequent messages to maintain a valid conversation state. Stripping these IDs or summarizing the JSON leads to immediate 400 API errors. You must preserve the exact structural mapping, even if it costs tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:54:33.302629+00:00— report_created — created