You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update on the third sub-symptom: the /acp panel served to thin plugins (pi / dsh / opencode, GET /__bili/plugin/status) had the same staleness defect, now fixed in PR#397 as well (commit 1a1178d).
Root cause (panel path):handlePluginStatus (src/plugin.ts) built the panel with the nudge remembered at the last model request (prepare-time snapshot). A compress executed through the plugin tool API mutates session.state without re-running prepare, so between the compress and the next request the panel mixed live blocks with stale, already-consumed ranges — the "old ranges and new blocks in the same frame" effect.
Fix: the panel now recomputes the nudge on every status request — processTurn over the remembered pre-fold view against the current session.state (same arbitration as the acp_status tool path). If recompute fails, the nudge/ranges sections are omitted rather than falling back to the stale snapshot.
Verification: new e2e in tests/plugin-protocol.test.ts ("plugin status panel recomputes the nudge after a mid-turn compress") — drives a real conversation, compresses m00001..m00002 via the tool API, asserts the panel lists the new block and no longer recommends the consumed range. Pre-fix this test fails (stale nudge keeps listing the consumed range).
Also confirmed while investigating (no changes needed):
acp-kernel (v0.0.54): buildStatusReport / buildStatusPanel / viability filter are pure functions of caller-passed state — the kernel computes the nudge fresh per processTurn; no defect on that side.
billion-context-pi: status-tool / commands both call runtime.core.processTurn fresh per invocation — clean, no issue filed.
PR#397 head is now 1a1178d (acp_status tool fix + dispatcher unification + this panel fix).
Activity
ranxianglei commentedon Aug 31, 2026
已修复,PR: #397
采用建议方案 1(现算),并顺带完成了验收标准第 3 条的收敛:
改动
src/acp-status.ts共享handleAcpStatus:base 报告之后(保留原有scope=短路分支——已核实该分支只含 live base,无陈旧数据),用 kernel 的纯函数processTurn对ctx.session.state + ctx.messages现算 nudge(已逐一验证所有 pipeline node 返回新对象、syncBlocks深拷贝 state,无副作用),tokenCount取session.stats.lastInputTokens(与下一次 prepare 完全同值,且applyRanges压缩后已即时扣减),ranges 复用 prepare 路径同款viableRanges一次性过滤。turn.state刻意不采纳——不触碰 nudge 节奏簿记;现算失败时降级为 base-only,绝不输出陈旧数据。stream.ts(executeAnthropicProxyTool)与compress-loop-responses.ts(executeProxyTool)原先裸调buildStatusReport且忽略全部 options,现在统一委托共享 handler——三种协议输出同一形状,且都支持scope/view/tool/sort/limit。LoopCtx.nudge字段及其两处赋值点(server.ts、plugin.ts)——冻结快照从此无法再漏进报告;plugin 工具路径自动获得 live 行为。测试(
tests/acp-status.test.ts,3 个新测试)applyRanges压缩后不经过新 prepare 立即handleAcpStatus→ 被压 refs 不再出现于 Compressible ranges,b1 活跃,Nudge 行与 state 派生一致(实测:Nudge: idle — max compressible 1250 < threshold 50000,ranges 只剩m00007–m00007)。scope=短路:仅 base,无 ranges/Nudge 区。runCompressLoop+ responses adapter,同轮compress+acp_status——acp_status marker 不再列出刚压掉的区间。Pre-flight:typecheck 干净;
npm test871/871 通过(868 旧 + 3 新);build 成功。E2E(codex 套件)本环境无 codex 二进制/本地 upstream 跑不了,已在 PR body 注明,可走 CI 手动触发。顺带发现(未改,建议另开 issue):plugin UI 面板
buildStatusPanel(src/plugin.ts)仍读 prepare 时刻的 nudge 快照做展示——同类陈旧问题、不同表面,超出本 issue 范围,已在 PR body 标注为 follow-up。fix #387: plugin status panel recomputes nudge from live state
ranxianglei commentedon Sep 6, 2026
Update on the third sub-symptom: the /acp panel served to thin plugins (pi / dsh / opencode,
GET /__bili/plugin/status) had the same staleness defect, now fixed in PR#397 as well (commit 1a1178d).Root cause (panel path):
handlePluginStatus(src/plugin.ts) built the panel with the nudge remembered at the last model request (prepare-time snapshot). A compress executed through the plugin tool API mutates session.state without re-running prepare, so between the compress and the next request the panel mixed live blocks with stale, already-consumed ranges — the "old ranges and new blocks in the same frame" effect.Fix: the panel now recomputes the nudge on every status request —
processTurnover the remembered pre-fold view against the current session.state (same arbitration as the acp_status tool path). If recompute fails, the nudge/ranges sections are omitted rather than falling back to the stale snapshot.Verification: new e2e in
tests/plugin-protocol.test.ts("plugin status panel recomputes the nudge after a mid-turn compress") — drives a real conversation, compressesm00001..m00002via the tool API, asserts the panel lists the new block and no longer recommends the consumed range. Pre-fix this test fails (stale nudge keeps listing the consumed range).Also confirmed while investigating (no changes needed):
buildStatusReport/buildStatusPanel/ viability filter are pure functions of caller-passed state — the kernel computes the nudge fresh perprocessTurn; no defect on that side.status-tool/commandsboth callruntime.core.processTurnfresh per invocation — clean, no issue filed.PR#397 head is now
1a1178d(acp_status tool fix + dispatcher unification + this panel fix).ranxianglei commentedon Sep 6, 2026
[bot] 🏷 收到面板路径的更新(PR#397,head
1a1178d,已确认 open、待合并)。同步一下本 issue 我这条线的收尾状态,均已实测验证:内核修复(批量门文案)— 已发布
acp-kernel: 0.0.54(v0.1.87 起捆绑)。本仓库最后残留 — 新 PR:#578
src/preflight.ts:274注释里的同一虚假断言("every successful compress renumbers the surviving refs")。非用户可见文本,但会把 acp_status 缝合报告:Compressible ranges/Nudge 读冻结的 ctx.nudge,压缩成功后旧区间与新块同框并存 #387 的同一错误认知传播给后续读 preflight 循环的人。grep -r renumber src/ tests/无结果。汇总:三个子症状至此各有归属——① 批量门假文案(内核 PR#175,已随 0.0.54 发布)、② acp_status 工具快照陈旧(PR#397)、③ /acp 面板快照陈旧(PR#397)。待 PR#397 与 PR#578 合并后,#387 的全部验收标准闭环,可以关闭。
Merge pull request #578 from ranxianglei/2026-09-06_fix-preflight-ren…
docs: correct false renumber claim in preflight comment (ranxianglei#387