Repository navigation
[PR] feat(contrib): billion_context_native - #1790
zhou1736948757-cpu wants to merge 24 commits into
Conversation
…-URL change) Standalone Python plugin that brings acp-kernel's compression rules, nudges, tiered summaries, rules and absorb hints to Claude Code using only hooks, MCP and the transcript JSONL, without routing traffic through a proxy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[bot] 🏷 Review started. Snapshot at first pass:
I'm pulling the branch locally to run the plugin's own test suite and walk the hooks/MCP/store code. Full structured review to follow. |
…P server Stock macOS (and many Linux distros) ship no bare 'python' on PATH, so every hook and the MCP server would fail to start and the plugin would be silently inert. python3 resolves on macOS/Linux and on Windows with the official Python installer.
… fs-independent The 55 pre-created old exports all land in the same mtime tick on filesystems with coarse granularity, making 'oldest exports are deleted first' depend on glob ordering (failed on Linux, passed on the original dev machine). Stamp explicit increasing mtimes.
[bot] 🏷 ## Review 结论(结构化七问)— PR #1790 Claude Code native-recall 插件 查重:按关键词(claude / recall / contrib / no-proxy)检索了全部 open+closed issues/PR,无重复项。与既有 1. 是什么问题:无法/不愿把 Claude Code 流量路由到本地代理的用户(典型:订阅制、担心请求被改写的用户)没有任何 acp-kernel 压缩通道;而 Claude Code 自带 compaction 是有损且不可找回的。本 PR 用 hooks + MCP + transcript JSONL 给这条人群补上"可找回的压缩"。 2. 什么原因导致的(约束层):hook 机制决定了插件只能"观察 transcript + 注入 additionalContext + 拦截 PreCompact",不能改写请求体——所以折叠单位只能是整段会话、prefix cache 每次压缩必重置、range folding/reasoning drop/cache_control 等全部不可行。PR 正文的 "What it cannot do without a proxy" 一节对这一边界表述诚实完整,方向成立:host compaction 保持唯一折叠机制,插件只做 gate + 供料 + 存档召回。 3. 怎么修复的(机制):PreCompact exit 2 门控自动压缩直到模型真实调用 4. 是否有回归问题:无。diff 为纯新增(14 文件全在 5. 是否破坏缓存:bili 侧不涉及(无任何改动)。插件侧:prefix cache 每次 compaction 重置——这是 hook 架构的固有代价,PR 已显式声明,非回归。 6. 是否改了设计方向:新增一条非代理 Claude Code 通道,与现有 proxy 路线互补而非替代(README 已说明两者差异);代码完全隔离在 contrib/ 下,不进 dist/、不被 src/ 引用,不污染边界。仓库已有 7. 是否引入了新的配置:billion-context 配置面零新增(符合 Configuration Surface Discipline;PR 正文有 Config surface 一节)。插件自有 env( 我已直接在分支上修掉的 3 个小问题(已 push:
|
|
重新叙述这个是啥问题 卡到哪里了 |
[bot] 🏷 一句话:这是外部用户(@zhou1736948757-cpu)提的 PR,给"不走代理的 Claude Code 用户"加一个独立的 Python 插件( 为什么需要它:现有 审查进度:已经审完并验证过——
卡在哪:卡在等作者回应 3 件事,其中只有第 1 件是真卡点:
作者回复第 1 件(最好连 2、3 一起)我就复核收工;合并操作留给你:#1790 |
… refs; README install Addresses review on ranxianglei#1790: 1. Hard line is per model: Haiku 180k (RECALL_HARD_HAIKU), others 300k (RECALL_HARD). A 'Prompt is too long' API error lets the next auto-compaction through, so a 200K-window model can never be stuck below the hard line; that error entry's zero usage no longer reads as an empty context. 2. Reminders name the actual turn range (#a-#b, current turn) so summaries can cite real refs. 3. README: install commands, Python 3, plaintext/no-GC archive note. Also: python3 alone breaks on stock Windows (Store alias / non-executable shim). Hooks now try ${RECALL_PYTHON:-python3} and fall back to python; the MCP server uses ${RECALL_PYTHON:-python3}, documented for Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
感谢审查,也谢谢顺手修的 3 处(已保留)。新提交
另外一点:hook 和 MCP 直接调用 测试 30/30 通过,含 Haiku 强制线、超长报错放行、压缩后轮次编号等新用例。麻烦再复核。 |
a566043 to
1da03a4
Compare
[bot] 🏷 复核完成(d79b1264):三点全部落实并验证,CI 全绿,可以合并。 按七问逐项:
我这边的独立验证:
顺手直接修的两处(已推分支,head 现为
判定:可合并。 合并操作留给你:#1790 |
|
这个pr我看了 但是还是不理解场景是啥 现在bili提供外部压缩服务 是不是配置cc自己压缩自己即可? |
[bot] 🏷 好问题,把场景说透: 「配置 CC 自己压缩自己」= Claude Code 内置的 auto-compaction,它本来就开着、不需要任何配置。 插件不是替代它——恰恰相反,它是唯一保留 CC 自带折叠作为折叠机制的方案。问题在于内置压缩是单向有损的:压掉的内容变成一段模型摘要,原文永久找不回来(没有 recall)。这个插件干的事就是在内置压缩外面包一层:压缩前全量存档 → 模型择机写摘要而不是等系统硬切 → 压缩后补回最近 5 轮原文 → 之后随时 所以三条路线的取舍是:
bili 覆盖不了的那块就是「必须改 base URL」这个硬前提:订阅制(Pro/Max)用户把流量指到本地第三方代理有账号风险顾虑,还有一类用户就是不接受请求被中间层改写/转发。作者定位的就是这批人——PR 里也明说了代价:凡是需要改写请求才能做的事(range folding、prefix cache 保持、图片剥离等)都做不了,这是 hook 架构的物理上限,不是偷懒。 一句话:如果「CC 自己压缩自己」对你够用(即你能接受压了就找不回),那确实不需要这个;它的存在只为「不过代理 + 要可找回」这个交集。场景是真实的但偏窄——如果你觉得窄到不值得进主树,作者开头就主动提了可以挪去独立仓库、README 只留链接,两条路都通,你拍板即可。 |
|
我之前用过类似的对话流量经过本地服务,期间账号被封过,但不确定是网络问题还是中转方式的原因,所以我想保留 cc原本的请求链路,尽量减少额外的中间环节。减少c被封号的风险 |
[bot] 🏷 你的理解完全准确,和我们的分析一致:
补一个对称的提醒,让取舍完整:不中转换来的是本地磁盘暴露面——存档(对话原文+摘要+规则)以明文存在 场景定位到这里没有分歧了,剩下的是放置问题(进主树 |
|
还有就是,我看到有人说 cc 的桌面端改不了 url,我这个因为是原生的,所以桌面端也可以用 |
[bot] 🏷 这个点我查了官方文档,基本成立,而且比「能用」还多一层含义:
一个精确性备注:这只覆盖桌面端的本地会话;如果会话被发到 Cloud/SSH 环境跑,那些环境不读本机的 settings/hooks,插件不生效(本地存档和召回仍然可用,只是门控不在)。 至此场景证据链齐了:订阅用户 + 桌面端无 base-URL 入口 + 要可找回压缩 → 只有这条路线通。放置问题仍等 @ranxianglei 拍板(进主树 vs 独立仓库)。 |
|
这个pr可以合并 ework需要处理下冲突 并且需要把这个方案做的通用化一点 做完一个任意客户端都可选的一个方案 |
…s acp-kernel 0.0.166 (branch had stale 0.0.165 ci-fixes sync)
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复 —— 本车道即此 PR 的冲突处理任务;检索 open+closed 无平行的 recall/native-recall 冲突工作项。 冲突已解决 —— GitHub 确认 mergeable=True(head
|
Keep both hosts on the shared append-only archive and stable paginated MCP reader. Include Claude Code v0.3.2 schema compatibility fix, complete scoped tests, and explicit native-validation limits. Preserve the original PR history.
Declare the main persona in six DSH test fixtures after the generic single-shot sidecar gate was added upstream. Keep all BLOCKED-ref, request-count, cross-wire fold, and watermark assertions unchanged. Validated the six failing cases on both the PR merge tree and upstream, then passed 48 related tests with explicit main markers, typecheck, and build. Preserve the original Recall contribution unchanged.
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Full-diff review (60 files, +8104/−5) plus local run of the plugin suite. Code quality is high — positives at the bottom. One blocking item.
Blocking: unrelated master-level CI fix bundled into this PR
Commit bb373ae4b (“fix: mark DSH regression fixtures as main requests”) modifies six repo-root test files outside contrib/:
- tests/issue2419-dsh-skill-catalog.test.ts:220
- tests/issue2446-dsh-mcp-catalog.test.ts:246
- tests/issue2447-dsh-workspace-instructions.test.ts:231
- tests/issue2481-dsh-runtime-context.test.ts:243
- tests/issue2817-crosswire-persona-fold.test.ts:122
- tests/issue5403-watermark-fastpath.test.ts:158
Those fixtures failed on master after #5687 added the generic single-shot sidecar gate (isDshSingleShotSidecar, src/server/side-request.ts:203) — an inherited red every open PR carries. The canonical fix for exactly this red already exists on origin/ci-fixes (0470bec62, “test(ci): realign five dsh regression pins to the #5656 sidecar residual (#4599)”). Per AGENTS.md CI-coordination policy, master-level fixes must converge on ci-fixes; carrying a second, differently-shaped fix inside a feature PR will collide textually when ci-fixes lands and scatters one failure domain across two places.
Fix: drop bb373ae4b from the branch (git revert bb373ae4b or rebase it out), then git merge origin/ci-fixes and push. The PR diff then stays scoped to contrib/claude-code-native-recall/.
Non-blocking
- PR description is stale on scope. The body describes only the Claude Code plugin, but 9631c55 also adds a full OpenCode V2 native adapter (
opencode/index.js,opencode_bridge.py,archive.append_native,tools/opencode-native-validation/). Please update the body (or narrow the scope). - PR description says “26 tests”; the suite is 162 (README.md:5 and VALIDATION.md both say 162; local run:
Ran 162 tests ... OK). - Informational:
opencode/index.js:119hard-pins OpenCode V2.2.5 and throws otherwise — intentional fail-fast and documented, just noting every host upgrade breaks activation until the plugin ships. Separately,mcp_server.py’s stdin loop parses each line unguarded; one malformed line would kill the MCP process (low risk — hosts send well-formed JSON-RPC).
What I verified (positives)
- No changes under
kernel/, nopackage.json/lockfile/version changes, no config-surface changes, nothing insrc/beyond the six test files above. Pure addition undercontrib/claude-code-native-recall/. - License: NOTICE carries MIT + attribution crediting acp-kernel v0.0.99. Spot-checked the vendored prompt text against the in-repo kernel (now 0.0.169): COMPRESS_PHILOSOPHY, EMERGENCY_HEADER, the open-objectives carry-forward rule, absorb minToolTokens=4000, rule limits 50/300 — all match verbatim.
- Local run of the plugin suite: 162/162 pass (stdlib-only, ~62s).
- Engineering quality is strong: atomic writes with fsync + dir sync and flock; symlink rejection across all path handling; session-id validation; bounded responses (64 KiB cap with wire reserve); env scrubbing for bridge spawns; bridge stderr dropped (private data); hooks fail-open so they never veto host execution; the OpenCode adapter is strictly opt-in (explicit projects/sessions lists, project re-check on every capture); honest completeness/conflict labels instead of invented turns or receipts.
- Behavior disclosure: none — bili itself is untouched; no old→new drift in any existing behavior.
|
(ai: vllm-qwen/qwen3.8-27b) Review 结论(结构化八问)— PR #1790 当前 head
|
This reverts commit bb373ae. Address PR ranxianglei#1790 review 5782867946: remove the branch-specific main-header fixture repair before integrating the canonical ci-fixes change from ranxianglei#5718. Preserve the complete Recall contribution and existing commit history.
Merge the canonical 0470bec fix after reverting the duplicate main-header repair, addressing PR ranxianglei#1790 review 5782867946. Keep the Recall subtree byte-identical (8702851), preserve all contribution history, and leave upstream PR merging to maintainers. Validated the integrated tree: 49 targeted DSH regression tests; 162 Recall tests; 7 OpenCode adapter, 12 guard, 5 native-test-plugin, and 10 structured-checker checks; repository typecheck and build. Full repository verdict remains the remote CI on this new head.
[bot] 🏷 Review 车道收工报告(PR #1790,head 判定:REQUEST_CHANGES(正式 review id 5782867946,完整八问结论见上一条镜像评论)。
|
Keep archive identity and legacy configuration compatible across Claude Code, OpenCode and DSH. Preserve semantic tool names and use a protocol-safe Claude Code MCP namespace.
…rding Review round-2 spot fixes (strings only, no behavior change): - README.md: remove pointer to review/CC_GAP_AUDIT.zh-CN.md, which is not present anywhere in this branch or master (dead link). - archive.py append_native(): docstring and three ValueError messages still said OpenCode after b352543 generalized the path to opencode+dsh hosts.
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
第二轮审核(head a676135,顺手修后 8dade69)
第一轮唯一阻塞项已解决
- bb373ae(六个根级 dsh 测试夹具)已 revert 并合入 origin/ci-fixes:当前 head 的六个测试文件与规范修复
0470bec62(#5718)逐字节一致;PR head 与 origin/ci-fixes 在 contrib/ 之外 diff 为零。master 级继承红不再在 PR 内重复维护。
本轮新增代码(DSH 车道 + 产品改名)通过审核
- DSH 适配器(dsh/index.mjs、dsh_bridge.py、dsh_read.py):与 OpenCode 车道同一纪律——显式 enabled+projects+sessions opt-in、宿主版本钉 0.2.0-rc.2 不符即抛、SAFE_ENV 隔离、bridge ACK 校验(durable/host/session_id)、degraded 闩锁仅由成功全量快照清除、stderr 丢弃、低信任封套注入。append_native 由硬编码 opencode 泛化为 host 参数,identity 覆写保护保留。
- 改名(→ billion_context_native):manifest/MCP/hooks/文档全部一致,无旧引用残留(仅 MIGRATION.md 有意保留历史名);env 新名优先 + RECALL_* 回退(含显式空值语义);存储路径不变;CC MCP key 缩短为 native 以避开 64 字符工具名上限。
- 测试有效性:真断言非恒真——test_rename_compat.py 钉 env 优先级矩阵、旧档案跨前缀切换字节级不变、locator 可读回;test_plugin_identity.py 钉 manifest 一致性 + 64 字符上限 + 真实 MCP spawn。本地全套 187 tests OK(上轮 162);顺手修后定向复跑 37 例 OK。
- 镜像 CI:a676135c1 上 30/30 绿(顺手修 commit 仅字符串改动,将在 8dade69 重跑)。
非阻塞备注(作者侧,建议合并前处理)
- 标题/正文过时:标题仍写 Claude Code only;正文未提 OpenCode/DSH,仍写 "26 tests pass"(实际 187),安装命令仍指向旧路径 contrib/claude-code-native-recall。建议合并前同步,让合并记录与实际内容一致。(按仓库规则我不代改标题/正文。)
- 宿主版本硬钉(OpenCode V2.2.5 / DSH 0.2.0-rc.2 不符即抛)——文档已声明为有意的 fail-fast,可接受;知悉宿主升级需插件跟进即可。
- mcp_server.py main() 对 stdin 的 json.loads 无保护——单条畸形行会杀掉整个 MCP 进程(宿主发送格式良好的 JSON-RPC,风险低)。属协议层行为选择,不动,仅记录。
已顺手修:README 死链(指向本分支与 master 均不存在的 review/CC_GAP_AUDIT.zh-CN.md)+ append_native 泛化后仍写 OpenCode 的 docstring 与三个错误消息改为 host 中性措辞(纯字符串,无测试依赖)+ commit 8dade69
八问结论
- 是什么:外部贡献者在 contrib/ 下新增 opt-in 本地原文归档召回插件(CC/OpenCode/DSH 三车道),不改 bili 主仓任何行为。
- 原因:功能类,无缺陷;第一轮阻塞项是继承性 master 红(#5687 sidecar gate)被重复修复,现已收敛到 ci-fixes 规范修复。
- 影响范围与严重程度:既有用户零影响(各车道默认关闭、须显式 opt-in);bili 本体零影响(纯新增 contrib/ 目录 + 六个与 ci-fixes 一致的测试文件)。
- 怎么修复的:本轮验证 DSH 车道与改名完整性;两处小字符串问题当场修掉。
- 回归:未发现——六个测试文件与 ci-fixes 逐字节一致、contrib/ 外零 diff、kernel/版本号/配置面/wire 均未触碰;本地 187 OK + CI 30/30 绿。
- 缓存破坏:不涉及(插件不触碰 bili 缓存/持久化,自有档案为独立 events.jsonl)。
- 设计方向:不变;通用化方向符合 owner 指示,核心取舍仍在 #4857/#4858 待决策。
- 新配置:仅插件自身 env(BILLION_CONTEXT_NATIVE_* + RECALL_* 兼容回退),文档齐全,不进入 bili 配置面。
判定:APPROVE —— 审核侧无阻塞;合并由你决定。
[bot] 🏷 第二轮审核完成(head a676135 → 顺手修后 8dade69),判定 APPROVE,review 已提交(#pullrequestreview-5784784510)。
回归面:kernel/版本号/bili 配置面/wire 均未触碰,未发现回归。合并权在 owner。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
第三轮审核(head 8dade69)——确认轮,无新代码
当前 head 即第二轮我审毕后推回的顺手修 commit(纯字符串:README 死链 + append_native host 中性措辞),此后作者无新提交。本轮复核:
- ci-fixes 对齐仍成立:六个 dsh 测试文件与
0470bec62逐字节一致;contrib/ 之外 diff 为零;ci-fixes tip 未变。 - 作者已处理第二轮备注:标题更新为 billion_context_native,正文补齐 OpenCode/DSH 范围、187 tests、新安装路径——上一轮非阻塞项全部关闭。
- 镜像 CI:本 head 上 29/30 绿,仅 windows(node22, shard3) 一个标准套件分片仍在跑;顺手修只动 contrib/ 内字符串(不在 bili 测试路径内),不影响该分片结果。
- 无 kernel/ 触碰、无 kernel-change 声明、版本号未动、配置面未动。
第二轮的完整八问结论与代码评估(review id 5784784510)继续有效。
判定:APPROVE —— 维持,可合并(合并权在 owner)。
[bot] 🏷 第三轮审核完成(head 8dade69),判定维持 APPROVE(review id 5786446315)。 本轮为确认轮——head 即第二轮我审毕后推回的顺手修 commit(纯字符串改动),作者此后无新提交。复核结果:
第二轮完整八问结论(review id 5784784510)继续有效。可合并(合并权在 owner)。 |
(ai: vllm-qwen/qwen3.8-27b) CI 自动修复车道 attempt 1/3 收工:两条红分片均为负载型 flake(非本 PR 引入),rerun 后全矩阵转绿,分支零代码改动。 处置链:逐一取证两条失败 job → 判定 flake(证据见第 3 问)→ 对两个失败 job 发 rerun(HTTP 201)→ run 42025471606 终态 八问:
结论:CI 面已全绿(run 42025471606 success @ 8dade69),无遗留动作;合入判定以 review 车道为准(review-worker 已于本 head 给出 APPROVE)。 |
[ework] CI fix verified green ✓ |
(ai: vllm-qwen/qwen3.8-27b) CI 自动修复车道 attempt 1/3 收工:唯一红分片为在册 flake(非本 PR 引入),rerun 后全矩阵转绿,分支零代码改动。 处置链:拉取失败 job 日志取证 → 判定为 #4599 在册的 settle-race flake 家族 → 本地在新 head 上定向复跑验证 → rerun 失败 job(HTTP 201)→ run 42263654719 终态 八问:
结论:CI 面已全绿(run 42263654719 success @ eb6f523),无遗留动作。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE — head a3fa4eeab(master 合并 + 4 个 contrib 提交)。代码本体干净;唯一保留意见是 CI 观测面(见下),不影响代码判定。
审核独立性说明
本轮独立重读:四-dot 范围核对、四个新提交逐段精读(store.py/mcp_server.py/hooks.json/docs/tests)、本地全套回归。未复用前轮结论。
① 方向关
owner floor 25 拍板「可合并 + 通用化」;通用化已立项 #4857/#4858(独立决策线,不阻塞本 PR)。本轮四个提交全部在该方案内收敛,无方向漂移。第一轮阻塞项(bb373ae4b 六个根级测试)保持已解决状态:与 ci-fixes 0470bec62(#5718)逐字节一致,ci-fixes tip 未变。
② 回归审查(既有行为清点)
- PR 对 master 的净贡献 = 仅
contrib/billion_context_native/:git diff --name-only origin/master...a3fa4eeab在 contrib/ 之外为零文件。kernel/、src/、tests/、package*.json、AGENTS.md 的全部变化都是 453ce1c 合入 masterc3dfbe6b2带来的(#5758/#5719/#5540 等),非本 PR 内容。PR 自身未触碰 kernel/(四个作者提交逐一核对无 kernel/ 路径),正文也无 kernel-change 声明——硬规则不触发。 - 行为变更披露(旧值→新值):规则 ID 方案变更——旧:顺序
ruleN(回放按位置推导);新:live 调用铸造rule<十进制UUID>(bfe2d37f0,mcp_server.pyrule_id=f'rule{uuid.uuid4().int}'),回放以成功确认文本中的 ID 为准(ack-based,store.py replay_rules 重写)。原因:并行调用基于滞后视图可同时成功,位置推导会错绑归属;UUID 使每个确认唯一可绑定。旧ruleN由 ack 回放保持兼容,删除后不复用(kernel id-never-reused 语义保持)。README + VALIDATION『Update review』均已披露,含「删除时原样使用返回值,不要推算编号」的使用指引。判定:有意变更、已披露、语义更诚实,非回归。 - 冲突挂起语义(a3fa4eeab):历史中不同调用确认同一 ID → 规则整体挂起 +
rule_conflict提示,仅「唯一完成且明确成功」的 clear 可解除(RULE_RESET_ACK 精确匹配或精确 legacyCleared N rules.),旧 ID 保持占用,归档原文不删不改。宁可挂起不可猜归属——与插件既有低信任纪律一致。status() 在冲突时仍返回其余指标(不再整调用报错)。 - hooks.json 引号修复(bbc0571a7):全部 14 条命令
P=...; "$P" ...——含空格解释器路径(Windows 常见)此前会断词,纯 shell 健壮性修复,无行为面扩大(不引入新 env 别名,文档已声明)。 - _live 先 sync events.jsonl(mcp_server.py):读 transcript 前先拉 hook 观察事实,规则/状态读取更完整;sync 失败走既有 deferred 语义。
- 高危模式逐项过:fail-fast 变吞错——无(冲突是显式报错不是静默);阈值漂移——无(SOFT/STEP/HARD 等常量未动);输出格式——规则 ID 格式已披露;缓存/游标——事件账本 seq/offset 机制未动。
③ 代码审查
ack-based 回放逻辑逐行读过:ack 解析 Recorded \[(rule[1-9]\d*)\] (.+) 与 apply_rule 返回格式匹配(含 UUID 大整数与 DOTALL 多行文本);回显文本比对用 strip 后输入(与服务端 .strip() 一致,无误报);rejected/failed 结果不计入变更;无 ack 的 legacy 调用走位置回退但跳过已占用编号(while 循环保 id 不复用);current_rule_state 三级来源(归档有规则调用→归档;否则 transcript;否则 rules.json 存档,含冲突态保存恢复)。质量达标:命名达意、错误带上下文、无死代码、注释讲为什么。
④ 测试有效性
test_rule_ids.py 17 个用例是真断言且钉住回归:并行双成功确认保留两条、同 ID 冲突不猜归属、拒绝结果不重放、legacy 删除后编号空洞跳过、归档冲突跨源压缩存活、late restore 不重注入过期投影、清除需唯一正证据……每个都对应一类真实失败模式,bug 复发时抓得住。hook 引号回归用含空格路径 + 无回退解释器的合成环境钉住全部 14 条命令。
本地验证
python3 -X utf8 -m unittest discover -s tests(a3fa4eeab)→ Ran 205 tests, OK(~94s),与作者 VALIDATION 声称的 205(含 17 项规则身份/恢复)一致。
CI 观测(如实报告)
镜像缓存(本 head a3fa4ee):18/30 绿;11 个核心 test 分片 + red-signal 为 completed/cancelled,未见替代运行。分支 tip 未移动过(排除被新推送取代)。因本 PR 在 contrib/ 之外零贡献,bili 根套件内容与 master c3dfbe6 字节一致(其 CI 已绿),cancelled 分片不构成新的未验证面;但取消本身值得哨兵看一眼——已在 #4599 留一行。建议合并前如分片仍未补齐,重跑一次套件即可。
结构化八问
- 是什么问题:continuation PR——通用化 native recall 插件的第四轮更新(master 合并 + 规则身份修复 + Windows 验证 + hook 引号)。
- 什么原因导致的(各提交):规则 ID 位置推导在并行滞后视图下会错绑归属(根本缺陷);含空格解释器路径断词;旧重复 ID 历史无恢复通道。
- 影响范围与严重程度:仅插件用户;规则冲突挂起只影响已有损坏历史的会话(显式提示 + clear 出口);ID 方案变更对所有新增规则可见但已披露且有兼容层。体验级,无数据丢失(归档原文永不改写)。
- 怎么修复的:身份从「位置推导」改为「确认绑定」(ack 即身份,位置仅作 legacy 回退且避让已占用 ID);冲突显式化 + 受控重置;shell 引号。
- 是否有回归问题:无。kernel/bili 配置面/wire 未触碰;ci-fixes 对齐保持;id-never-reused 语义在新旧两路都保住。
- 是否破坏缓存:不涉及(事件账本 offset/digest 机制未动)。
- 是否改了设计方向:否——在 owner 批准的通用化方案内收敛;核心通用化待 #4857/#4858 决策。
- 是否引入新配置:否(无新 env/config;RECALL_PYTHON 沿用)。
判定:可合(合并权在 owner)。
[bot] 🏷 第四轮审核完成(head a3fa4ee = master 合并 + 4 个 contrib 提交),判定 APPROVE,review 已提交(#pullrequestreview-5804985870)。
回归面:kernel/bili 配置面/wire 均未触碰,未发现回归。合并权在 owner。 |
中文
概述
本 PR 将原有独立贡献统一命名为
billion_context_native,提供 Claude Code、OpenCode 和 DSH 的原生 Recall 适配。三个适配器共享本地追加式归档,支持搜索和分页读取宿主已暴露并成功归档的历史内容。适配器保留宿主原有的压缩和模型连接方式,不修改服务商地址、OAuth、全局 fetch、内核或 billion-context 的代理行为。OpenCode 和 DSH 适配需显式启用。旧配置、归档路径和定位符保留兼容。
审查意见处理
已撤销此前单独添加的 6 处测试夹具修改,并整合 #5718 中统一的
ci-fixes修复。原有历史得到保留,未使用强制推送。验证
限制
Recall 无法重建宿主未暴露、观察前被截断或适配器关闭时遗漏的内容。适配器不宣称能够阻止宿主原生压缩。测试不证明宿主已完全遗忘旧内容;Windows、macOS、其他宿主版本、自动压缩和长期高并发负载仍未全面验证。
归档在本地以明文保存历史内容。召回的历史内容应视为不可信数据,不得作为新指令或授权。
English
Summary
This PR renames the standalone contribution to
billion_context_nativeand provides native Recall adapters for Claude Code, OpenCode and DSH. The adapters share a local append-only archive and support searching and paginated retrieval of history exposed by the host and successfully archived by Recall.The adapters preserve each host’s native compaction and model connection. They do not change provider URLs, OAuth, global fetch, the kernel or billion-context proxy behavior. OpenCode and DSH integrations are opt-in. Compatibility is retained for existing configuration, archive paths and locators.
Review follow-up
The six independently added test-fixture changes have been reverted, and the canonical
ci-fixeschanges from #5718 have been integrated. Existing history was preserved without force-pushing.Validation
Limits
Recall cannot reconstruct content the host did not expose, content truncated before observation, or content missed while an adapter was disabled. The adapters do not claim to block native compaction. These tests do not prove that all older content was forgotten by the host; Windows, macOS, other host versions, automatic compaction and long-running high-concurrency workloads have not been comprehensively verified.
Archives contain local plaintext history. Retrieved historical content must be treated as untrusted data, not as new instructions or authorization.