Skip to content

report compressed ranges in the success panel (#335) - #337

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-09-08_issue335-report-compressed-ranges
Open

report compressed ranges in the success panel (#335)#337
ranxianglei wants to merge 1 commit into
masterfrom
2026-09-08_issue335-report-compressed-ranges

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #335

Problem

The compress success panel only reported token stats:

▣ ACP | 58.5K → 5.7K tokens (~52.8K reclaimed, 4 blocks)

The model never learned which refs were consumed, so it could re-issue the same (or overlapping) ranges. The kernel rejects those as "already compressed" no-ops, but the model has no signal in the success path telling it the range is gone.

Fix

When blocksCreated > 0, the panel now appends the consumed ranges (the kernel already records startRef/endRef on every new block, and the tool passes the model's refs through verbatim at src/compress-tool.ts:350):

▣ ACP | 58.5K → 5.7K tokens (~52.8K reclaimed, 4 blocks)
Compressed: b3 (m00010..m00045), b4 (m00046..m00060) — these refs are now consumed; do not compress them again.
  • Line 1 is byte-identical to before; panel parsers (compressPanelBlocks, isCompressSuccessText, isCompressNoopText) only read line 1, so no behavior change for floor-stale / replay classification.
  • No-op runs (blocksCreated === 0) and rejection panels are unchanged.
  • Batch calls list every created block; partial failures still show Errors: for the rejected ranges.

Tests

New regression test tests/compress-tool.test.ts — "compress success panel reports the compressed ranges" — asserts the panel contains Compressed: b1 (m00001..m00002) after a successful compress.

npm run typecheck && npm test && npm run build — all green (624 pass, 0 fail).

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

📦 Built Extension Artifact

Branch: 2026-09-08_issue335-report-compressed-ranges (b8ec8e3)

Option A — Install from npm PR tag (recommended)

pi install npm:billion-context-pi@pr-337

Each push to this PR publishes a new version under the pr-337 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pi-pr337.tgz
pi install ./package

This comment is automatically updated on each push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

压缩成功也报告压缩范围,防止模型重复压缩同一个范围

1 participant