Repository navigation
feat: report new block ids and actual ref spans in compress result panel (#376) - #377
Conversation
📦 Built Extension ArtifactBranch: Option A — Install from npm PR tag (recommended)pi install npm:billion-context-pi@pr-377Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pi-pr377.tgz
pi install ./packageThis comment is automatically updated on each push. |
…parens compressPanelBlocks' span-form branch captured with `[^)]*`, which stops at the ")" inside tier labels like `b3(T2)=...`, undercounting any batch whose first new block is T2/T3 (two T2 blocks parsed as 1). Both current consumers use only boolean >0/===0 so nothing breaks today, but that still violates the function's own "block count" contract for a reachable input. Count the `bN=`/`bN(Tn)=` label tokens in the header line instead. Exported for direct unit testing + regression test. Review fix on #377 (feature #376). typecheck + tsup build clean; 658 pass / 0 fail / 3 skipped.
Reviewed against master. Diff is clean — 5 files, all feature-scoped, no whitespace/unrelated churn. Ran typecheck + tsup build + full suite on the head: baseline 657 pass / 0 fail / 3 skipped, matching your claim. Found one real defect in the new parser and fixed it directly on the branch (commit Bug — Impact — none in the current tree. Both consumers ( Fix — count Everything else checks out:
Verdict: mergeable — the fix commit is already on the PR branch; no further changes required from me. 一句话中文总结:修复了新增 |
Enables the nudge-side half of the #375 fix: active block map ('Active blocks (N): b1=m00001–m00009 · …') and per-range user-msg counts in efficiency/emergency nudges. Nudge text is rendered by the kernel (renderNudgeText), so no adapter code changes are needed. The compress-result block spans (#376) already shipped via #377.
…anel-format test(export): assert post-#377 panel format in setupSession
…ompress calls (ranxianglei#336) Exact semantic alignment with opencode-acp ranxianglei#377 (owner-locked design): compress calls are hard-exempt from compression, so their thinking rides along every request as an unreclaimable context floor. A request-time pass (src/reasoning-drop.ts) removes thinking parts only when ALL gates hold: closed turn (strictly before the last genuine user message), compress toolCall selector, and total reasoning length strictly exceeds threshold chars (2048 default, summed per-message; 0 drops any non-empty). The active round is never touched; persisted history is never modified; pure/idempotent/fail-safe. Config: compress.reasoning { drop, threshold } merged field-wise across the existing three levels (model > provider > global). OpenAI-style opaque reasoning opts out per-provider: { "compress": { "providers": { "openai": { "reasoning": { "drop": false } } } } } Applied to the rebuilt outgoing view BEFORE the nudge push so a synthetic user-role nudge can never become the boundary. Fixes ranxianglei#336
…parens compressPanelBlocks' span-form branch captured with `[^)]*`, which stops at the ")" inside tier labels like `b3(T2)=...`, undercounting any batch whose first new block is T2/T3 (two T2 blocks parsed as 1). Both current consumers use only boolean >0/===0 so nothing breaks today, but that still violates the function's own "block count" contract for a reachable input. Count the `bN=`/`bN(Tn)=` label tokens in the header line instead. Exported for direct unit testing + regression test. Review fix on ranxianglei#377 (feature ranxianglei#376). typecheck + tsup build clean; 658 pass / 0 fail / 3 skipped.
…ss-result-block-spans feat: report new block ids and actual ref spans in compress result panel (ranxianglei#376)
Enables the nudge-side half of the ranxianglei#375 fix: active block map ('Active blocks (N): b1=m00001–m00009 · …') and per-range user-msg counts in efficiency/emergency nudges. Nudge text is rendered by the kernel (renderNudgeText), so no adapter code changes are needed. The compress-result block spans (ranxianglei#376) already shipped via ranxianglei#377.
…port-test-panel-format test(export): assert post-ranxianglei#377 panel format in setupSession
… block/ stale after ranxianglei#376/ranxianglei#377 panel change
…port-cmd-stale-assertion fix(tests): use isCompressSuccessText in export-cmd setupSession (stale /1 block/ after ranxianglei#376/ranxianglei#377)
背景
#375 中发现:模型对"之前的压缩块覆盖到哪里"的记忆与 nudge 推荐的 ranges 矛盾,被迫先调 acp_status 验证再执行(~1.8K tokens + 一轮 LLM)。根因:compress 结果行只报
N blocks,不报新块 ID 与实际覆盖——模型只能从自己提交的 startId/endId 推断;而 kernel 的保护排除与 turn-integrity 撤回会在事后改变实际范围,每次 compress 后块账本都偏差一点,累积到与 nudge 冲突。改动
src/compress-tool.ts:新增blockSpanLabel(block, state)——取effectiveMessageIds的首尾 ref 作为实际跨度(而非请求边界);跨度内存在仍存活但未被该块覆盖的 ref(被保护/撤回排除)时标*;tier ≥ 2 标(T2)/(T3);单消息跨度渲染为裸 ref(与 kernel 渲染约定一致);无法解析 ref 时退化为裸块 ID。▣ ACP | 61.1K → 13.7K tokens (~47.4K reclaimed, blocks: b3=m00044–m00097*, b4=m00103–m00123*)0 blocks(与 dead/cap 拒绝面板一致);compressPanelBlocks双格式兼容——index/floor-stale 的日志回放路径必须继续解析历史 transcript 里的旧面板。测试
blockSpanLabel单元(连续 / 内部排除*/ 尾部排除不标*/ 编号空洞非排除 / 单消息裸 ref / tier 标注 / 不可解析退化)、解析器双格式兼容。/1 block/断言(decompress-cmd、integration ×5、view-recount)——它们对真实输出断言旧格式,随本次有意的输出契约变更同步更新。无 acp-kernel 依赖 bump——纯本仓库改动。配套 acp-kernel#251(nudge 块地图)落地后,两项共同消除验证性 acp_status 往返。
Fixes #376