From dfc63a7bac276e9fa98d114adc5959584a3e4b05 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 31 Dec 2025 12:35:45 +0100 Subject: [PATCH] Note settings.json for compaction settings in compaction.md --- packages/coding-agent/docs/compaction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/docs/compaction.md b/packages/coding-agent/docs/compaction.md index a1753a4e..168ce198 100644 --- a/packages/coding-agent/docs/compaction.md +++ b/packages/coding-agent/docs/compaction.md @@ -23,13 +23,13 @@ Auto-compaction triggers when: contextTokens > contextWindow - reserveTokens ``` -By default, `reserveTokens` is 16384 tokens. This leaves room for the LLM's response. +By default, `reserveTokens` is 16384 tokens (configurable in `~/.pi/agent/settings.json`). This leaves room for the LLM's response. You can also trigger manually with `/compact [instructions]`, where optional instructions focus the summary. ### How It Works -1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k) is reached +1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.pi/agent/settings.json`) is reached 2. **Extract messages**: Collect messages from previous compaction (or start) up to cut point 3. **Generate summary**: Call LLM to summarize with structured format 4. **Append entry**: Save `CompactionEntry` with summary and `firstKeptEntryId`