Repository navigation
fix: #3272 disarm CCR arming on the codex responses lane (unroutable acp_retrieve) - #3277
Conversation
…acp_retrieve) On the responses wire a codex host rejects bili-injected tools at its tool router and records a synthetic "unsupported call" entry in its own resent history. An armed CCR there declares acp_retrieve (unroutable by the host) and placeholderizes oversized tool results the model can never retrieve back (silent loss); every retrieve round-trip permanently forks client history from ours (prefix-cache collapse). Same structural mechanism as image_full's restore channel (#3266/#3270). Gate the CCR arming stamp with !(protocol === "responses" && isCodexClient), mirroring #3270's adjacent image_full gate. Disarmed -> no tool declaration, no placeholder substitution; large tool results stay verbatim until regular folding. Other lanes/wires unaffected; plugin-mode responses already excluded via PLUGIN_CCR_WIRES. CCR is opt-in, so this only touches codex responses users who explicitly enabled compress.ccr. Test: tests/issue3272-ccr-codex-lane-gate.test.ts pins codex->disarmed / non-codex->armed on the native responses wire.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3783-pr.3277.2f5ee5fThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3277.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 与 #3266/#3270 同属一个宿主机制家族(codex 在工具路由层拒绝 bili 注入的工具,并在自己重放的历史里写入合成 独立审核(对 diff 重做一遍,不复用 #3272 线程的结论)① 原 issue(方向关):根因定位正确。CCR 武装谓词 ② 回归审查(触碰路径的既有行为逐项清点):
③ 代码:唯一武装点加单一谓词。 ④ 测试有效性:不是 mock 测试——真实请求穿过 ⑤/⑤b diff 整洁度:2 个文件,每一行都服务于本 PR 目的;命名、注释、风格符合仓库惯例;无死代码、无无关改动。✅ 结构化八问
行为变更披露(old → new)范围:codex 客户端 + responses wire + 显式开启 CCR 的用户。
验证证据
判定:可合(待余下 6 个 test shard 转绿,当前无任何失败)。备注:本 PR 与 #3270 在同一 stamp 块相邻行,后合者 rebase 时会有一次琐碎文本冲突,两种顺序语义都干净。 |
(ai: vllm-qwen/qwen3.8-27b) CI 已全部转绿:41/41 lane 全部 success(含 12/12 test shards,ubuntu/windows × node 22/24),零失败。上一条审核结论的待决条件已满足——判定维持:可合。合并动作按仓库纪律由人工执行。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.453-master.545db5f # this exact build
npm install -g billion-context@master # always the newest merged build
|
Summary
Disarm CCR arming on the codex responses lane so bili never declares
acp_retrieve— or emits placeholders — to a host that structurally cannot route them. Same host mechanism as image_full (#3266/#3270).Root cause
The codex host rejects bili-injected tools at its tool router and records a synthetic
function_call_output = "unsupported call: <name>"in its own resent history (proven empirically forimage_fullin #3266/#3270).acp_retrieverides the identical injection path: proxy-mode CCR arms on the responses wire wheneverinjectTool && storeChannelOk && ccr.enabled === true, with no host check. So a codex client sees anacp_retrievedeclaration it can never route. When the model calls it (the CCR placeholder actively invites this), the client's history forks from ours → prefix-cache collapse + failure loop, and placeholderized content becomes unretrievable (silent loss).Fix
Mirror #3270's image_full gate at the CCR stamp site (
src/server/handle.ts): skip the stamp whenprotocol === "responses" && isCodexClient(headers). Disarmed →ccrEnabledfalse → the kernel ccr-store node substitutes no placeholders andprepare-responsesinjects no retrieve declaration. Regular compress/decompress/search_context folding is untouched.Behavior change (old → new)
Scope: codex client on the responses wire, with CCR explicitly enabled (
compress.ccr.enabled=true; CCR is opt-in since #1207, off by default).acp_retrievedeclared + large tool results placeholderized (a token saving) but retrieval structurally broken — one retrieve away from history fork / cache collapse / silent loss.acp_retrievedeclaration, no placeholder substitution (large tool results stay verbatim until regular folding); all other context tools unchanged.No other lane / wire / mode is affected (predicate scoped to
responses && isCodexClient).Relationship to #3270
Independent (this closes #3272, not #3270). Both add the same
!(protocol === "responses" && isCodexClient(...))predicate on adjacent lines of the same stamp block, so whichever merges second rebases over a trivial textual conflict — semantically clean in either order.Tests
tests/issue3272-ccr-codex-lane-gate.test.ts(new) drives a real request through the proxy on the native responses wire and asserts the outbound body: codex UA → noacp_retrieve/placeholder + verbatim tool result; non-codex control → still arms (regression guard against over-disarm). Local: typecheck green + new suite 2/2 + marker-gate control 3/3 + 65 CCR-area tests green. Full regression deferred to CI.Closes #3272