Repository navigation
fix(ccr): plugin-mode sessions execute the base ccr block exclusively - #1360
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1360Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1360.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Picked up — this is completed work (PR #1360), so I'm reviewing rather than re-doing it. Pulling the branch ( |
[bot] 🏷 Review 结论:PR #1360 可以合并(需人工 merge)。完整审查如下。 ① 方向关(原 issue #1345)— 通过。实现与 BsoBird 在 #1345 thread floor 5 批准的方向逐条一致:(a) plugin mode 整体执行 base ccr block(arm 仅看 base ② 回归审查 — 按触碰路径清点既有行为:
高危模式检查:无 fail-fast→吞错、无阈值/默认值漂移、输出格式除已披露的 warn 行外无变化、kernel pin 未动(两侧均 0.0.93)、持久化形状未变。 ③ 代码审查 — 两个小 nit,均不阻塞:
未发现逻辑/不变量/错误处理/安全问题。 ④ 测试有效性 — 断言有牙:e2e name-divergent 断言 manifest 内容、placeholder hint 名、session gate 名、store ref 存在,并走真实 ⑤ diff 整洁度 — 单 commit、9 文件,每一行都服务于 issue 目的;无空白 churn、无 lockfile/生成物 churn(acp-kernel pin 未动)。已本地 rebase 到 d3c8af8 验证干净(共享 src/config.ts 的重叠区不相交)。 验证证据:CI(head dec9930)11/11 全绿(test ubuntu/windows ×22/24、e2e、hermetic registry、real pi/codex lanes、version-guard、build-artifact)。本地 rebased head(master d3c8af8 + PR):typecheck ✓ · build ✓(dist-import-annotations OK)· 全量套件 2639 pass / 0 fail / 11 skipped(共 2650;PR 正文的 2629 是旧 base 数字,master 其后新增 ~21 个测试)。 行为变更(复述 PR 披露):OLD plugin sessions 执行三级 merged ccr policy 而 manifest 广播 base block → NEW plugin sessions 仅执行 base block,provider/model overrides 仅 proxy lane 生效并在 load 时告警。Proxy mode 不变。有意变更、thread 内批准、披露到位。 按 §7.4 不属于 auto-merge(多模块 policy 变更 + 产品决策)→ 需人工合并。 中文摘要:审了 #1345 的修复(plugin 模式 CCR 执行 merged policy 而 manifest 广播 base block 的分裂):改为 plugin lane 专属执行 base 配置、load 时按字段告警被忽略的 override,proxy lane 行为逐项验证不变,CI 11/11 绿 + 本地 rebase 后全量套件 2639/0/11 全过,建议关闭已被取代的 PR #1352,可以合并。 |
|
Deep review: ✅ merge. Verified on the triple-stacked tree (#1367+#1361+#1360, all merges clean; typecheck + full suite green on the stack; this PR's 6 tests pass in isolation AND on the stack). Design holds up — and it generalizes correctly. #1345 named two divergences (toolName rename, enabled=false), but the root cause is structural: in plugin mode the static manifest is the host's ONLY declaration of the retrieve surface, and it reads the base config alone — so any per-field divergence between base and merged splits declared from dispatched. This PR fixes the class, not the instances: the session stamp carries the whole base block verbatim for plugin sessions (merged block for proxy sessions), and Points I probed specifically:
Docs: both CONFIGURATION.md and zh-CN updated with the plugin-lane governance paragraph. ✅ Merge note for the release: the three CCR PRs (#1367, #1361, #1360) stack cleanly in any order (verified pairwise + triple); no sequencing constraint. |
[bot] 🏷 收到,感谢深审确认。协调项已闭环:PR #1352 已关闭(superseded),我 review 中提出的唯一阻塞性协调问题不复存在。 当前状态(刚查过):#1367 / #1361 / #1360 三者均 open、待人工合并;按你的验证结论无顺序约束,任意顺序合并即可。合并链接:https://github.com/ranxianglei/billion-context/pull/1360(我无法代合,规则限定 PR merge 为人工操作)。 发布备注素材(供 release notes):三个 CCR PR 同批落地时,行为变更集中在 #1360 一条 —— plugin-mode sessions 从执行三级 merged ccr policy 改为仅执行 base block(provider/model 中文摘要:确认 #1352 已关闭、三个 CCR PR(#1367/#1361/#1360)均 open 且验证可任意顺序合并,合并需人工操作,已附发布备注的行为变更要点。 |
In plugin mode the manifest is the host's only declaration of the retrieve surface, yet sessions armed from the three-level merged ccr policy: a provider/model-level toolName rename pointed the execution gate away from the advertised name (endpoint 400s, stored content unreachable), and enabled=false disarmed a session whose manifest still advertised acp_retrieve (silent verbatim forwarding). - stamp site: plugin mode stamps the base ccr block (arm iff base enabled); proxy mode unchanged (stamps the merged block) - new store.ccrLoopConfig resolves the loop config from the session stamp; every processTurn call site uses it (one policy source) - config load: per-field divergence warning naming level/field/value (once per load; hot-reload path collapses to one loadOptions call) - docs en+zh: plugin-lane governance note under compress.ccr - tests: e2e toolName/enabled divergence (plugin lane base-governed, proxy lane keeps its overrides) + findCcrPluginDivergences unit + loadOptions diagnostic integration Behavior change: provider/model-level ccr.* overrides no longer apply to plugin-mode sessions (they made the advertised tool unexecutable or silently disarmed it); they stay in effect for proxy-mode sessions. Every affected override now logs at config load. Fixes #1345 # Conflicts: # src/config.ts # src/server.ts
dec9930 to
efce7c8
Compare
|
Rebased onto master ( Master had moved under this PR twice since the review: #1367 (retrieve lifecycle imports) and #1369's absorb divergence machinery — the same warn-at-load pattern as this PR's ccr machinery, in adjacent code — plus its
Gates on the rebased head: typecheck ✓ · ccr-plugin 10/0 · absorb-plugin 10/0 · store 16/0 · fork-ccr-adoption 6/0 · full suite 2772 tests, 0 fail (12 e2e-gated skips). CI re-runs on this head; merge when green. |
… agree (ranxianglei#1359) The plugin manifest advertised absorb under its static constants while per-session adjudication resolved the merged route/model name, so a renamed absorb.toolName made the advertised tool 400 (same silent-loss class as ranxianglei#1345, wider trigger surface: one base-level rename suffices). - resolveAbsorbSettings(): single source of truth for raw->resolved absorb, shared by applyCompressSettings and the plugin-lane base stamp. - server.ts: in plugin mode the whole absorb block follows the BASE config (advertise + adjudicate the same name); provider/model absorb.* overrides stay proxy-lane-only. Proxy mode unchanged (still honors the merged name). - plugin.ts: manifest advertises the resolved name via absorbToolsFor(), which builds byte-identical wire shapes at the default name. - config.ts: load-time per-field divergence warning (findAbsorbPluginDivergences), mirroring the ranxianglei#1360 ccr diagnostic. - docs (en+zh): document lane governance for absorb.toolName. - tests/absorb-plugin.test.ts: regression coverage (plugin manifest follows the resolved name and the gate agrees; proxy still honors the merged override; default shapes byte-identical; divergence diagnostic fires/stays silent). Fixes ranxianglei#1359
What
#1345: in plugin mode the manifest — the host's only declaration of the retrieve surface — is built from the base config, but sessions armed from the three-level merged ccr policy. Two divergences reproduced:
ccr.enabled=true+ provider/modelccr.toolNameoverride → manifest advertisesacp_retrieve, but the session gate wants the renamed name → the advertised tool 400s at/__bili/plugin/tool, stored content unreachable, placeholder hints print the wrong name.ccr.enabled=true+ provider/modelccr.enabled=false→ manifest still advertises, but the merged policy disarms the session → oversized results silently forwarded verbatim.Fix (direction approved in the #1345 thread)
src/server.ts): plugin mode now stamps the base ccr block (arm iff base enabled); proxy mode unchanged (stamps the merged block). Normalization strictly inside the pluginMode branch, so per-route renames keep working on the proxy lane.store.ccrLoopConfig(session, config)resolves the loop config from the session stamp (kernelDEFAULT_CCR_CONFIGfill); everyprocessTurncall site (src/server.ts×8,src/preflight.ts,src/acp-status.ts,src/plugin.ts) uses it — the stamp becomes the single CCR policy source.src/config.ts):findCcrPluginDivergences()reports every provider/modelccr.*field diverging from the base block, once per config load (the web hot-reload path is collapsed to a singleloadOptions()call so it fires once per reload):[acp-config] ccr override ignored in plugin sessions: <level> ccr.<field>=<value> — plugin sessions use <effective> …compress.ccr.findCcrPluginDivergences,loadOptionsdiagnostic integration. Also fixed a latent cross-test pollution trap in this file (conversation-id reuse against the file-global SessionStore — see comment abovepostOpenai).Behavior change (old → new)
ccr.*overrides remain in effect for proxy-mode sessions only (they were never executable on the plugin lane). Every affected override logs a warning at config load.Sibling finding (separate issue)
The same divergence class exists for
absorb: the manifest always advertises the staticABSORB_TOOL_NAME(src/plugin.ts:578-581), never following anabsorb.toolNamerename at ANY level including global, while adjudication reads the effective name (src/absorb.ts:52). Filed as #1359 — reproducible with one top-level config line; the normalize-at-stamp + load-diagnostic pattern transfers directly. Not bundled here (distinct root cause/surface).Pre-flight
typecheck ✓ · full suite 2629/2629 pass (11 skipped by design) ✓ · build ✓ · tests/ccr-plugin.test.ts 10/10 ✓
Fixes #1345