Repository navigation
Conversation
|
ework 接单 |
[review] 已接单并完整复核 #637(todo continuity across compression)。结论:核心设计与正确性 LGTM,合并前建议补上单元测试(已写好,见文末),另有两个小项值得处理。 验证(在干净
|
|
简述这个是什么功能 并补充对应 issue |
三件事都办好了: 1. 这个功能是什么解决「压缩后 todo 状态丢失」的问题。 当客户端的 本 PR 的做法:当
2. 对应 issue已补:#639(feature issue:问题 / 方案 / 契约 / 实现)。 3. 测试(我来改,已落地到本 PR)已在 PR 分支提交并推送:commit Fixes #639 |
|
参考我名下的 opencode-acp 项目 应该对类似消息实施保护 而不是压缩后召回。 另外我理解类似保护已经存在。 todo 消息保护特殊性在于只保护最近一条即可 可能内核需要协同改动甚至改动仅仅发生在内核 |
[bot] 🏷 收到,方向明确:改成「保护」而非「压缩后召回」,对齐 opencode-acp 原语义。先确认现状,再给方案,最后是需要你拍板的点。这一轮我只做设计分析,未动代码。 1. 现状确认:保护机制已经存在(你的判断对)acp-kernel(billion-context 内联的压缩内核)已经有 opencode-acp 那套「保护而非召回」的机制:
billion-context 侧: 2. 差距:「只保护最近一条」现有机制给不了
而 todo 状态是累积快照(revision N 含当前完整状态),旧 todo 结果严格冗余,只有最新一条是 source of truth。所以「只保护最近一条」既正确又高效——但这不是上面两个机制能直接表达的。 3. 推荐方案(对齐 opencode-acp 语义)内核加一个「最近一条」保护模式 + 宿主暴露配置:
跨仓库代价(重要):按 AGENTS.md 跨仓依赖,acp-kernel 必须先发版,billion-context 才能 bump。顺序:acp-kernel 加 4. 需要你拍板
我的建议:走内核路线、一次到位(避免临时版返工),并同步把 #639 的描述从「召回」改成「保护」。你确认后我按 acp-kernel → billion-context 顺序开做。 |
|
建议增加按照工具名字的保护,而不是 compress.protectTodo, 所有配置通用化 |
|
继续 |
[bot] 🏷 继续完成——内核侧已做完,PR 已开:acp-kernel#223 本轮做了什么按 floor 14 的定调(按工具名保护、硬/软两档、配置通用化)在内核实现了「最近一条」保护: acp-kernel PR #223(open,branch
下一步(需要你操作)跨仓规则:内核必须先发版(billion-context 精确 pin + CI
本 PR 的 carrier 实现先保持原样不动,等保护方案落地后由 billion-context 侧 PR 移除。 |
[bot] 🏷 收到队列扫描结论,已逐项复核(2026-09-19),阻塞判定成立:
后续路径不变:kernel #223 需人工 merge → acp-kernel 发版(§5 跨仓规则)→ 本 repo pin bump + 通用配置落地 + 移除 carrier 方案 → 本 PR 收口。跟踪 issue #639。 一句话:复核确认本 PR 被 acp-kernel#223(未合并)阻塞且 0.0.79 无对应导出,判定正确,等 kernel 先行,无需 agent 动作。 |
|
Kernel-side unblock confirmed: acp-kernel#223 was merged into kernel master in 043cc68 (
Related: acp-kernel#332 (rules reconciliation) is also pending release; if both land in the same kernel release, one pin bump unblocks both this and #750. |
[bot] 🏷 已逐项复核,核心结论成立(kernel 侧已解锁),但有两处事实偏差需要更正: ✅ 确认
|
c5aa321 to
d85e2a2
Compare
|
Unblocked: kernel 0.0.80 (with Rebase notes — 5 conflict sites in
Pre-flight on the rebased head: typecheck PASS · tests 2014/2014 (2 gated E2E skips; includes this PR's todo-continuity suite) · build PASS. Review suggestion (follow-up, not in this rebase): with kernel 0.0.80 the host can now declare |
- ranxianglei#223 protectedLatestTools: collectLatestProtected / isMessageLatestProtected — kernel primitive for 'protect only the latest instance of a tool' - ranxianglei#332 acp_rule rules API: RULE_TOOL_NAME, DEFAULT_RULE_LIMITS, addRule/listRules/removeRule/clearRules, resolveRuleLimits, formatRulesForPrompt/formatRulesList, CompressionState.rules?/nextRuleId?, Config.rules? Unblocks ranxianglei#750 (acp_rule feature) and ranxianglei#637 (todo/capsule continuity) for rebase.
[bot] 🏷 已在独立 worktree 对 rebased head( ✅ 验证(全部与报告一致)
💡 我的建议:走 (b),slim 成配置声明(#635 kernel-adopt 模式)理由:
若拍板 (b),执行计划(仍在本 PR 收口,不开新 PR)
需要你确认的一个产品决策:默认值建议 一句话:rebased head 独立复跑全绿(typecheck/2012 pass/build),rebase 质量认可;建议按你此前定调走 (b) 瘦身为通用 toolProtection 配置声明并移除 carrier,待你确认默认开启后我直接在本 PR 实施。 |
…compression Kernel-adopt rework of the host-side todo replay (#639 / PR #637): the kernel grew a native primitive for exactly this (acp-kernel #223, protectedLatestTools, shipped in 0.0.80), so the host-side re-injection is superseded — protection now happens inside the kernel pipeline where it covers every wire and both compression modes for free. - src/config.ts: CompressSettings.protectedLatestTools (string[] of tool-name patterns, glob-capable) + strict parseCompressSettings validation (non-empty string array, entries trimmed; malformed rejects the whole compress block per the parse-state guard convention). - src/compress-settings.ts: three-level deepest-wins merge (whole-array replace) + applyCompressSettings passthrough onto the kernel Config. - tests/protected-latest-tools.test.ts: parse/merge/plumbing asserts + end-to-end kernel behavior — an explicit compress range spanning the latest todo_list pair cannot fold it (latest call+result refs render as BLOCKED, unaddressable), older instances fold normally; with no configuration everything stays foldable (default off). - Docs: CONFIGURATION.md/.zh-CN.md field reference; README.md/.zh-CN.md note next to the acp_rule protection paragraph; web UI field list. Default: none — tool names are client-specific, opt in per deployment (e.g. ["todo_list", "TodoWrite"]). Fixes #639
d85e2a2 to
29215a0
Compare
…compression Kernel-adopt rework of the host-side todo replay (#639 / PR #637): the kernel grew a native primitive for exactly this (acp-kernel #223, protectedLatestTools, shipped in 0.0.80), so the host-side re-injection is superseded — protection now happens inside the kernel pipeline where it covers every wire and both compression modes for free. - src/config.ts: CompressSettings.protectedLatestTools (string[] of tool-name patterns, glob-capable) + strict parseCompressSettings validation (non-empty string array, entries trimmed; malformed rejects the whole compress block per the parse-state guard convention). - src/compress-settings.ts: three-level deepest-wins merge (whole-array replace) + applyCompressSettings passthrough onto the kernel Config. - tests/protected-latest-tools.test.ts: parse/merge/plumbing asserts + end-to-end kernel behavior — an explicit compress range spanning the latest todo_list pair cannot fold it (latest call+result refs render as BLOCKED, unaddressable), older instances fold normally; with no configuration everything stays foldable (default off). - Docs: CONFIGURATION.md/.zh-CN.md field reference; README.md/.zh-CN.md note next to the acp_rule protection paragraph; web UI field list. Default: none — tool names are client-specific, opt in per deployment (e.g. ["todo_list", "TodoWrite"]). Fixes #639
Reworked to kernel-adopt (per maintainer review): the host-side todo replay is superseded by acp-kernel's native
protectedLatestToolsprimitive (#223, shipped in 0.0.80 — already pinned on master via #1030). This PR is now a clean single commit on current master that plumbs the config through and drops the host-side machinery entirely.What it does
compress.protectedLatestTools: ["todo_list", "TodoWrite"]— tool-name patterns whose latest tool-call + paired result are hard-excluded from every compress range (refs render asBLOCKED, unaddressable by suggested or explicit ranges). Older instances of the same tool fold normally, so cumulative-snapshot tools (todo/task lists) never grow unboundedly and the agent never loses its live task list to a fold (#639).Kernel-side protection covers every wire and both compression modes for free — no per-wire wiring, no synthetic replay messages, the REAL tool-call/result stays byte-stable in place.
Changes
src/config.ts—CompressSettings.protectedLatestTools+ strictparseCompressSettingsvalidation (non-empty trimmed string array; malformed rejects the block loudly)src/compress-settings.ts— three-level deepest-wins merge (whole-array replace) +applyCompressSettingspassthrough onto the kernel Configtests/protected-latest-tools.test.ts— 6 tests: parse accept/reject, merge precedence, plumbing, and end-to-end kernel behavior (spanning range cannot fold the latest pair; default stays fully foldable)CONFIGURATION.md/CONFIGURATION.zh-CN.mdfield reference,README.md/README.zh-CN.mdnote beside theacp_ruleprotection paragraph, web UI field listDefault: off (no
todo_list) — tool names are client-specific; operators opt in per deployment.Pre-flight (rebased on master @ 2b027f1)
Fixes #639