Commit Graph

4 Commits

Author SHA1 Message Date
Josh Lehman
a69f64470d
fix: truncate oversized messages before compaction summarization
Truncate oversized messages before compaction summarization to avoid
context limit failures. When individual messages exceed the chunk token
budget, they are flattened to text and truncated to fit within limits.

This prevents the 'prompt is too long' error during compaction that was
causing sessions to reset with empty summaries.

- Add truncateMessagesForSummary function to pre-process messages
- Apply truncation in summarizeChunks before chunking
- Preserve tool call names and image placeholders in truncated content
- Add tests for truncation behavior
2026-01-27 21:14:38 -08:00
jigar
dde9605874 Agents: summarize dropped messages during compaction safeguard pruning (#2418) 2026-01-26 20:35:08 -06:00
Peter Steinberger
ed05152cb1 fix: align compaction summary message types 2026-01-23 23:03:04 +00:00
Peter Steinberger
ae0741a346 feat(compaction): add staged helpers 2026-01-23 22:23:23 +00:00