Repository navigation
Conversation
…anxianglei#4331) compress()'s stop signal is derived from the fold scanner's current offer, not from an actual coverage check. Messages that fall between two fold boundaries (the compress call's own turn, then the next fold starting after it) are never offered again and stay raw on every request — measured at 16% of live context in the current session and 20% in a 12k-message session. Add src/uncovered-history.ts: - coveredRefNumbers(state): active-block coverage, recursing directBlockIds so a tier-2 parent with an empty effectiveMessageIds list still covers. - uncoveredHistory(state, messages, options): contiguous runs outside every active block and older than the protected tail, token-estimated. - formatUncoveredHistory(): one head line plus the scoped-table caveat. acp_status always reports the audit (top 3 runs). The compress receipt keeps NO_RANGES_REMAIN_TEXT verbatim and only appends a note when the blind spot is material (>=10k tokens), so the ranxianglei#1387 "declined leftovers never re-nag" rule still holds. Tests: 6 new cases; compress-success-tail and acp-status suites stay green. tsc --noEmit clean. Refs ranxianglei#4331 (visibility only; fold-boundary absorption remains open).
|
Local verification (Windows, node 22, base 94f75cc + this branch):
The red checks on run 39823517252 are not from this diff. Both are master-side and already have open fixes:
I do not have admin rights to re-run workflows, so a re-run (or merging #4334/#4330 and then re-pushing this branch) is needed to get a real signal here. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 即 #4331 option 1(可见性)的实现本身。检索了 open/closed issue 与全部在途 PR:没有其他工作在做「活跃块覆盖 ∪ vs 线上 ref 全集」的覆盖审计。最接近的 #4045(codex forge 交接携带未覆盖尾巴)机制不同;#4334/#4330 是 CI 车道修复,与本改动无关。 标签: 结构化八问
代码审查要点(独立复核)
CI 状态:红,但 100% 继承自 master,与本 diff 无关head
结论:#4334 与 #4330 合入 master 后,本 PR 重跑 CI 即应转绿,无需为本失败做任何改动(分支落后 master 13 个提交,rebase 是好习惯但非本失败的前置条件)。 判定代码与行为通过审查:方向对(先让盲区可见,再谈吸收)、契约保真(停止信号逐字节不变 + 静默规则保留)、回归清点干净、测试有牙。待 #4334/#4330 落地且 CI 重跑绿后即可合并;我无法代合(系统规则:合并仅限人工),请 owner 操作:#4339 |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复——本单即 GitHub PR #4339 的跟踪记录(同号);评论提到的两处 CI 红对应 master 既有问题 #4333/#4336,修复 PR 已在途(#4334/#4330),无需新立项。 标签: bug, pr, p2, scope/kernel(压缩判定面「no ranges remain」结论的可见性缺陷,客户端无关;原 scope/wiring 改判为 scope/kernel——改动落在 src 侧压缩决策面而非协议接线) 验证结论:评论的说法成立,已独立复现。 两处红确属 master 既有缺陷,与本 PR 的 diff 无关。另有一层机制评论没点透:fork PR 的 CI 检出的是 merge preview(base+head)——本分支自身树里其实没有 逐项核实:
代码审查(实际 diff 4 文件 +341/-1,已通读):只读审计面,不碰 八问:
下一步(需 owner 动作):合并权限在人这边——请合并 #4334(一处覆盖两处红);之后我可以直接重跑本 PR 的失败 job(我有 admin 权限),或等任意 push 触发新 CI。现在重跑没有意义(master 没变,会原样再红)。 判定:本 PR 代码本身 ready,阻塞纯粹来自 master 侧两个待 #4334 合入的 CI 缺陷。 |
Problem
compress()answers "No compressible ranges remain — the context is already at its minimum" from the fold scanner's current offer, not from a coverage check. A span can be both uncompressed and unofferable: the fold committed at turn N coversm00001..mN(the compress call itself is turn N), and the next fold starts after N, so the traffic around the compression turn is orphaned forever. It stays raw on every request while the receipt claims completeness.Measured on two live sessions (SQL over
index.db, active blocks, coverage expanded throughdirectBlockIds):0.1.204, 864 msgs)0.1.197, 12k refs)Largest single run:
m00312–m00411— 100 consecutive messages (50 tool-call/result pairs, 201 KB). Roughly 30 of the 138 are the compression-machinery messages themselves.This is the mechanism behind #4331. This PR implements option 1 from the issue: make the gap visible. It does not absorb spans (option 2) — that stays open.
Change
New
src/uncovered-history.ts:coveredRefNumbers(state)— coverage of every active block, walkingeffectiveMessageIdsthroughstate.messageRefs.byRawand recursingdirectBlockIds(a tier-2 parent can carry an empty effective list; its children still cover).uncoveredHistory(state, messages, options)— contiguous runs of live messages that are in no active block, skipstate.deadRefs, merge split cores that share one ref, exclude the samepreserveRecentMessagestail the scanner protects, and estimate tokens withcountMessageTokens.formatUncoveredHistory(report, { compact? })— one head line with total + largest runs, plus the caveat that the Compressible-ranges table does not include these refs.Two call sites:
acp_status— always renders the audit (top 3 runs) after the live-ranges section, before DEAD REFS. This is the full inventory.compress receipt —
NO_RANGES_REMAIN_TEXTstays verbatim; a note is appended only when the gap is material (>= 10k tokens, top 2 runs). The compress 成功输出缺剩余范围快照与停止提示(pi 侧 #420/#521 对齐) #1387 / pi feat: dsh 进 PLUGIN_AGENTS——native 插件部署 + 拦截层(native 模式 D) #521 rule ("declined leftovers must not re-nag") is preserved: the sub-threshold residue fixture still emits the bare stop signal.Tests
tests/uncovered-history.test.ts(new, 6 cases): DirectBlockIds recursion; gap detection with the protected tail; split-core duplicate refs; deadRefs +minTokensfiltering;acp_statussection; receipt note fires for a material gap and stays silent for sub-threshold residue.tests/compress-success-tail.test.ts— 8/8 unchanged.tests/acp-status.test.ts— 9/9 unchanged.tsc --noEmit -p tsconfig.json— clean.Scope
Option 1 only (visibility). Closing the gap still needs fold-boundary absorption or a maintenance fold; with this PR at least the verdict no longer overstates coverage, and the refs are actionable.
Refs #4331.