fix: keep tool-use/result pairs intact during compaction

Preserve assistant tool_use / user tool_result adjacency when compaction trims message history.

Fixes #325.

Squashed original PR commits:

- Fix compaction breaking tool-use/result pairs

- Simplify compaction boundary fix
This commit is contained in:
wanna
2026-06-07 12:35:00 +08:00
committed by gui-yue
parent 3d018a0d48
commit 7891c25c12
7 changed files with 151 additions and 43 deletions

File diff suppressed because one or more lines are too long