From 5daf970cc1b06d4ded32a5cd21324dbd8d377e98 Mon Sep 17 00:00:00 2001 From: ranxianglei Date: Tue, 30 Jun 2026 09:37:00 +0800 Subject: [PATCH] fix(compress): raise maxSummaryLengthHard default to 3000, fix reject feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported in #42: the 800-char hard ceiling caused legitimate compressions to fail for real-world content (summaries routinely run 800-3000 chars). The ceiling is a safety net against pathological bloat, not a practical limiter, so 800 was miscalibrated. - config: maxSummaryLengthHard default 800 -> 3000 (soft target stays 200) - compress message/range: the reject message no longer tells the model to 'aim for <=200' (the soft target) at failure time — that was misleading. It now guides the model to trim under the actual ceiling and keep only essential detail. Tuning will be revisited with the upcoming compression-bundle feature; for now the search_context tool makes over-long summaries wasteful, so the soft target stays low. typecheck clean, 496 tests pass. --- lib/compress/message.ts | 2 +- lib/compress/range.ts | 2 +- lib/config.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/compress/message.ts b/lib/compress/message.ts index d759b9f..8d46791 100644 --- a/lib/compress/message.ts +++ b/lib/compress/message.ts @@ -55,7 +55,7 @@ export function createCompressMessageTool(ctx: ToolContext): ReturnType maxSummaryLengthHard) { throw new Error( - `Summary too long (${entry.summary.length} chars, hard ceiling ${maxSummaryLengthHard}). Aim for <=${ctx.config.compress.maxSummaryLength}; exceed only when strictly necessary. Rewrite more concisely.`, + `Summary too long (${entry.summary.length} chars; limit ${maxSummaryLengthHard}). Rewrite to under ${maxSummaryLengthHard} chars — keep only the most essential details (conclusions, file paths, decisions, exact values) and drop verbose narration or raw dumps.`, ) } } diff --git a/lib/compress/range.ts b/lib/compress/range.ts index f434c52..76699ef 100644 --- a/lib/compress/range.ts +++ b/lib/compress/range.ts @@ -70,7 +70,7 @@ export function createCompressRangeTool(ctx: ToolContext): ReturnType maxSummaryLengthHard) { throw new Error( - `Summary too long (${entry.summary.length} chars, hard ceiling ${maxSummaryLengthHard}). Aim for <=${ctx.config.compress.maxSummaryLength}; exceed only when strictly necessary. Rewrite more concisely.`, + `Summary too long (${entry.summary.length} chars; limit ${maxSummaryLengthHard}). Rewrite to under ${maxSummaryLengthHard} chars — keep only the most essential details (conclusions, file paths, decisions, exact values) and drop verbose narration or raw dumps.`, ) } } diff --git a/lib/config.ts b/lib/config.ts index 4c7af04..c926780 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -198,7 +198,7 @@ const defaultConfig: PluginConfig = { protectTags: false, protectUserMessages: false, maxSummaryLength: 200, - maxSummaryLengthHard: 800, + maxSummaryLengthHard: 3000, minCompressRange: 2000, }, strategies: {