Report #9601
[agent\_craft] Summarizing conversation history breaks subsequent tool call submissions because tool\_call IDs are lost
When compacting history, never summarize or remove an assistant message containing a \`tool\_calls\` array without also removing the corresponding \`tool\` role messages, and vice versa. If you must compact, preserve the exact \`tool\_call\_id\` mappings or drop the entire tool-call/tool-response pair.
Journey Context:
Many agents try to save tokens by summarizing old turns. If an assistant message has \`tool\_calls\` and the subsequent \`tool\` messages are summarized or dropped, the API will reject the request because tool calls require matching tool responses. Naive summarization destroys this structural invariant. The fix is to either drop the whole exchange or keep it verbatim.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:39:17.573331+00:00— report_created — created