Repository navigation
feat: enable CCR (acp_retrieve) on host/plugin lanes (#1271) - #1273
Conversation
CCR v1 shipped proxy-mode-only with a hard !pluginMode gate, so no real lane could turn it on. This wires the bili side of the three-repo contract: - plugin manifest advertises acp_retrieve only while ccr.enabled (#1192 rule), on anthropic/openai wires only — never responses, which the proxy disarms. - arming gate now allows plugin mode on exactly those round-trippable wires (ccrPluginWireOk); responses/google stay out so a placeholder is never emitted where it cannot be retrieved (silent loss, #1097). - prepare* drains pending retrievals in plugin mode so the full original rides back request-only (ephemeral, never persisted). - global ccr config threaded into the manifest so advertising reflects operator config, not just the kernel default. Adds tests/ccr-plugin.test.ts: manifest scoping + wire-scope unit tests + a plugin-lane e2e (fake upstream, zero tokens) proving store->placeholder-> retrieve->full-text round-trip.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1273Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1273.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…#1271) Reviewer fix: the behavior change disclosed in the PR body (plugin mode arms CCR on anthropic/openai wires while acp_retrieve is manifest-advertised) was not mirrored in the docs, which still stated 'proxy mode only / native-tools wires only' as the v1 scope gate.
[bot] 🏷 Review complete — verdict: mergeable (one docs fix already pushed to the branch; one cross-PR hazard flagged for merge ordering). Details below. ① Direction / original issue (#1271)Correct half of the three-repo contract, and it fixes the root cause at the decision point rather than masking: the hard ② Regression audit (existing behaviors touched)
③ CodeRead all four changed files end-to-end plus the kernel contract (
④ Test qualityThe 5 tests have teeth: advertising truth-table including the negative (never ⑤ Diff & evidenceClean single-purpose diff (+255/−16, 4 files, no churn). Evidence on head Fixed directly on the branch (reviewer commit)Docs lagged the disclosed behavior change — README.md:75, CONFIGURATION.md:367/374, CONFIGURATION.zh-CN.md:367/374 still stated "proxy mode only / native-tools wires only" as the v1 scope gate. Pushed Findings (not blocking this PR)
中文摘要:本 PR 在插件通道(anthropic/openai wire)上按线启用 CCR 并同步声明 acp_retrieve,方向正确、代理模式与 responses/google 行为完全不变、wire 安全与临时性均有内核保证,测试有牙且全绿(本地 2506/0 fail,CI 9/9);我已在分支上补了一个纯文档 commit 修正 README/CONFIGURATION 中过时的"仅代理模式"范围描述,可以合并——但请注意与 #1207(CCR 默认开启)的合并顺序:先合本 PR,#1207 落地时须同步更新 manifest 的 ccr 视图,否则会出现"已武装但未声明工具"的静默丢失。 |
[bot] 🏷 CI confirmation: docs commit 中文摘要:文档修正 commit CI 全绿(9/9),分支可合并。 |
…ding retrievals on disarm Review follow-ups for #1273: - The plugin arm now also requires opts.compress.ccr.enabled === true — the exact source the plugin manifest reads (server.ts:969). Route/model-scoped enablement with the base flag off previously armed the store and emitted placeholders while the manifest never advertised acp_retrieve: silent loss. Route-scoped-only enablement stays proxy-mode-only (the proxy injects the tool itself, per-request). - storeEffectiveCcr(undefined) now clears pendingRetrievals: a retrieve queued on a lane that later switches to a non-CCR wire would otherwise flush as a stale trailing full-text message when the lane re-arms. Not persisted either way; this only tightens the in-memory window. - e2e: acp_retrieve now driven through the real POST /__bili/plugin/tool endpoint (covers the conversation gate + ack round-trip), and a new regression test pins both halves of the route-scoped behavior (plugin lane verbatim, proxy lane armed). Fixes #1273 (review)
|
Review follow-ups landed at eb3a95c (same branch): Blocker fixed — plugin arm now gates on the manifest's exact source. Stale-injection window closed. Test realism. The e2e retrieve now goes through the real Gates on eb3a95c: typecheck clean, 2507 tests 0 fail (9 e2e-gated skips), build clean. |
[bot] 🏷 Follow-ups at ① Base-config arm gate (the blocker). Confirmed in code:
② Disarm drops pending retrievals. Safe: ③ Test realism. The e2e retrieve now goes through the real Evidence on Nothing left on my side — merge whenever you're ready (human-only, per repo rules). 中文摘要:已逐条核实 eb3a95c 的三项跟进——插件通道武装现在与 manifest 共用同一配置源(从根本上消除与 #1207 的合并顺序隐患)、解除武装时清空待注入队列(字段恒有初始化,无风险)、e2e 改走真实 tool 端点并新增双向回归测试;本地 2507/0 fail、CI 9/9 全绿,分支可以合并。 |
[bot] 🏷 Coordination note (from the #1281 review): open PR #1281 ( No conflict with master today, but whichever of the two merges second will hit a textual conflict on that one line. Suggested union resolution: keep #1281's |
What
Wires the billion-context side of the three-repo CCR contract (#1271, follow-up to #1097/#1099 and the #1179 default-on discussion). CCR v1 shipped proxy-mode-only with a hard
!pluginModegate, so no real host lane could turn it on. This enablesacp_retrieveon the plugin lanes where the round-trip channel provably works.Changes
src/plugin.ts):handlePluginManifestadvertisesacp_retrieveonly whileccr.enabled(the dsh acp rule报错 #1192 conservative rule), on theanthropic+openaiwires only — neverresponses, which the proxy disarms CCR on in plugin mode (advertising would guarantee a rejected call). Customccr.toolNamehonored.src/server.ts): the session CCR stamp now allows plugin mode on exactly the round-trippable wires viaccrPluginWireOk(protocol).responses/googlestay out so a placeholder is never emitted where it cannot be retrieved (silent loss, Feature: content-addressed message store — ID-referenced tool results + acp_retrieve (built-in CCR) #1097).src/server.tsprepareAnthropic/prepareOpenai): in plugin mode the pending retrieval is drained so the full original rides back as a request-only trailing message (ephemeral, never persisted into the agent's history).src/server.tsmanifest call site): globalcompress.ccris threaded into the manifest config so advertising reflects operator config, not just the kernel default.src/store.ts: newPLUGIN_CCR_WIRESset +ccrPluginWireOk()— single source of truth for wire scoping; the arming gate and drain sites stay in lockstep with it.storeEffectiveCcr(... && !pluginMode && ...)) — no placeholder ever emitted,acp_retrievenever advertised, on any wire.anthropic+openaiwires whenccr.enabled;acp_retrieveis advertised there while enabled.responses/googleare unchanged (still disarmed). Proxy mode is unchanged.Scope note (three-repo issue)
This is the billion-context half of #1271. The companion work lives elsewhere and is sequenced manually per repo policy:
billion-context-pi: its own config surface + registeringacp_retrievein the pi package's native ACP pipeline.acp-kernel: nothing blocking (0.0.86 already exports the full host contract).The e2e here simulates a plugin-lane client (fake upstream, zero tokens) driving the proxy-side machinery end-to-end; the true pi-package dogfood milestone (the remaining acceptance item) lands once
billion-context-piships its side.Tests
New
tests/ccr-plugin.test.ts(5 tests):acp_retrieveby default;ccr.toolNamehonored;PLUGIN_CCR_WIRES/ccrPluginWireOkwire-scope truth table;acp_retrieve→ full original rides back exactly once.Pre-flight on rebased head (current master
8e5eb582): typecheck ✓, build ✓, full suite 2506 tests / 0 fail / 9 skipped (skips are upstream-gated claude-native live e2e subtests).Part of #1271