来源: #368 (#368) 分析 "compress-call reasoning inflates the incompressible floor" 时发现
问题
rewriteCompressInput 在 compress 调用的所有 block 都被消费(kept 为空)时直接 return null,导致 compress part 原样保留,其内容(含 reasoning)泄漏到上下文中。
证据
lib/compress/hide-consumed.ts:42 rewriteCompressInput:
if (kept.length === content.length || kept.length === 0) return null;
kept.length === 0 = 所有 block 都被消费 → 返回 null → 不重写 → compress part 保留。
影响
- 完全消费的 compress 调用本应被
hideConsumedCompressCalls 隐藏,但此处泄漏,残留 ~3.7 KB/block。
建议修复
当 kept.length === 0 时应返回一个"空 / 已消费"标记(或让调用方隐藏该 part),而不是 return null(表示"不修改")。需区分"无需修改"与"应隐藏"两种语义。
来源: #368 (#368) 分析 "compress-call reasoning inflates the incompressible floor" 时发现
问题
rewriteCompressInput在 compress 调用的所有 block 都被消费(kept 为空)时直接return null,导致 compress part 原样保留,其内容(含 reasoning)泄漏到上下文中。证据
lib/compress/hide-consumed.ts:42rewriteCompressInput:kept.length === 0= 所有 block 都被消费 → 返回 null → 不重写 → compress part 保留。影响
hideConsumedCompressCalls隐藏,但此处泄漏,残留 ~3.7 KB/block。建议修复
当
kept.length === 0时应返回一个"空 / 已消费"标记(或让调用方隐藏该 part),而不是return null(表示"不修改")。需区分"无需修改"与"应隐藏"两种语义。