diff --git a/packages/coding-agent/docs/compaction.md b/packages/coding-agent/docs/compaction.md index daeaa434..2b34273a 100644 --- a/packages/coding-agent/docs/compaction.md +++ b/packages/coding-agent/docs/compaction.md @@ -262,6 +262,8 @@ Before summarization, messages are serialized to text via [`serializeConversatio This prevents the model from treating it as a conversation to continue. +Tool results are truncated to 2000 characters during serialization. Content beyond that limit is replaced with a marker indicating how many characters were truncated. This keeps summarization requests within reasonable token budgets, since tool results (especially from `read` and `bash`) are typically the largest contributors to context size. + ## Custom Summarization via Extensions Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.