When auto compaction runs after the model emits tool calls but before their tool results arrive, the pending calls disappear from the compacted context. This affects all tools.
The cause is normalize::pair_tool_call_items, which removes any ToolCall without a matching ToolCallOutput.
Expected behavior: preserve in-flight tool calls across compaction, or defer compaction until their results arrive.
When auto compaction runs after the model emits tool calls but before their tool results arrive, the pending calls disappear from the compacted context. This affects all tools.
The cause is
normalize::pair_tool_call_items, which removes anyToolCallwithout a matchingToolCallOutput.Expected behavior: preserve in-flight tool calls across compaction, or defer compaction until their results arrive.