Commit Graph

6 Commits (46290544038ef7809a4d33e459a5003ad0109fc6)

Author SHA1 Message Date
Christian Klotz f32eeae3bc fix: remove orphaned tool_results during compaction pruning
When pruneHistoryForContextShare drops chunks of messages, it could drop
an assistant message with tool_use blocks while leaving corresponding
tool_result messages in the kept portion. These orphaned tool_results
cause Anthropic's API to reject the session with 'unexpected tool_use_id'.

Fix by calling repairToolUseResultPairing after each chunk drop to clean
up any orphaned tool_results. This reuses existing battle-tested code
from session-transcript-repair.ts.

Fixes #9769, #9724, #9672
2026-02-05 20:37:53 +00:00
cpojer f06dd8df06
chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
cpojer 15792b153f
chore: Enable more lint rules, disable some that trigger a lot. Will clean up later. 2026-01-31 16:04:04 +09:00
jigar dde9605874 Agents: summarize dropped messages during compaction safeguard pruning (#2418) 2026-01-26 20:35:08 -06:00
Peter Steinberger da26954dd0 test(compaction): cover staged pruning 2026-01-23 22:25:07 +00:00
Peter Steinberger ae0741a346 feat(compaction): add staged helpers 2026-01-23 22:23:23 +00:00