You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The plain text content of MCP compress is not simplified, causing the full summary to be redundantly retained. | MCP compress 的纯文本 content 未被简化,导致完整摘要重复保留 #3975
changed the title [-]MCP compress 的纯文本 content 未被简化,导致完整摘要重复保留[/-][+]The plain text content of MCP compress is not simplified, causing the full summary to be redundantly retained. | MCP compress 的纯文本 content 未被简化,导致完整摘要重复保留[/+]on Oct 20, 2026
Correction to my previous comment — the mcp__client__compress whitelist entry is not needed for our lane.
I mislabeled the tool name. mcp__client__compress is how our own gateway (sitting downstream of bili, between bili and the Anthropic API) re-exposes client tools upstream. The request bili actually sees from OpenCode carries the bare built-in name compress (bili's proxy-injected tool), so the existing predicates already match it. Our gateway's own tool-batch records confirm the names it receives from bili are exactly compress / decompress.
Evidence that the parsing fix alone is sufficient on this lane: I applied a local patch to the shipped v0.1.212 dist/index.js equivalent to #4032's original fix (parseCallText falls back to the built-in splitLineEntries/parseLineEntry for plain-text line-form content; serializeCompacted keeps line form with the 200-char stubs; quotesActiveBlock recognizes the same form) — no name whitelist change.
Offline, against the 8 compress calls in a real request: arguments 48,425 → 5,569 chars, all ranges parsed correctly, output kept as plain text.
Live: right after restarting bili, the next request of that session already sent the stubbed tool_use.input for the past compress calls.
So please consider dropping the mcp__client__compress entry from the PR: it is not exercised by any real traffic we have, and client is a generic MCP server name, which is the same misidentification risk you rejected for suffix matching (#2578). Sorry for the noise.
Heads-up for gateways (not a bili bug, FYI): stubbing rewrites the input of an already-executed tool_use in history. Gateways that match history exactly can see that as "same tool id, different arguments". Ours rejected it once, at the turn where a just-made compress call was still awaiting its result; we now degrade it to a cold rebuild on our side. It is also a one-time prefix change, so there will be one cache rewrite per session when the fix rolls out. Keeping the stub deterministic and stable across turns (which it is today) is what matters.
更正上一条评论:我们这条链路不需要 mcp__client__compress 白名单。
我把工具名写错了。mcp__client__compress 是我们自己的网关(位于 bili 下游,在 bili 和 Anthropic API 之间)转发上游时给客户端工具起的名字。bili 实际从 OpenCode 收到的是 bili 代理自己注入的裸名 compress,现有谓词本来就能识别。网关的工具批次记录也证实,从 bili 收到的工具名就是 compress / decompress。
Still happening on 0.1.212 in the OpenCode 2 plugin lane (./server, tool name compress).
I folded one range through /__bili/plugin/tool on a throwaway daemon, then resent the history with the client's compress call:
Plain-text content (what the schema asks for): the full summary goes out twice on every later request, once as BILI's [Compressed conversation section] render and once in the call arguments.
Array content: the call gets cut to a 200-char stub and the render is stripped too, so no full copy reaches the model at all. The array form isn't a safe workaround in this lane.
In a long session this is about 36k tokens per request, and each fold makes the provider bill the duplicate uncached.
#4032 looks right for this lane as is: once it stubs the line-form call, buildCarrierIndex still can't parse that call, so the render stays as the one full copy. If someone later teaches buildCarrierIndex or reconcilePluginFoldCallIds the line form, the plugin lane ends up where the array form is now, with the stub and no summary.
Thanks for the lane-specific data — I verified all three points against the v0.1.212 code (identical to current master for these paths; the v0.1.212→master diff of src/server.ts doesn't touch the carrier index).
Line-form double-send (first bullet): confirmed — this is exactly the mechanism #4032 fixes, and your end-state analysis holds: once the call is stubbed, buildCarrierIndex still can't parse line-form args, so the render stays as the one complete copy.
Array-form "no full copy reaches the model": verified as mechanics, but this is shipped by-design behavior, not a bug (#1567 carrier handoff). In the plugin lane the contract makes the client's own re-sent tool-call pair the summary carrier: stripKernelSummaries strips the redundant acp_summary render only while that pair actually rides the post-prepare history and range-matches the block (src/server.ts:2730-2732) — if the pair were pruned or absent, the anchor is kept, so an active fold never ends with zero carriers. The full text isn't lost: it persists in OpenCode's stored history (re-sent verbatim every turn — your repro proves its presence, since the strip requires the range match) and in the kernel block (decompress restores it). The model saw the full summary on the fold turn itself; a stable 200-char stub afterwards is the intended lean steady state, same as every other correctly-working plugin lane. So "not a safe workaround" is a misread — nothing is lost, it just isn't re-sent.
One honest asymmetry: post-#4032, line-form blocks keep their standing render (one full copy per request) precisely because the index can't parse them — the fail-safe direction. So in your lane, line-form will cost more per request than array-form until someone teaches the carrier index the line form.
Forward constraint: recorded. I added a design note to the PR body — teaching buildCarrierIndex / reconcilePluginFoldCallIds the line form moves line-form blocks to the same stub-only steady state, which is acceptable only while ≥1 complete carrier survives (client-side pair / decompress); no variant may ship where neither the stubbed call nor the render carries the full text.
Status:#4032 is already rebased onto current master and CI is fully green (run 41952551785, head e8fc736). Merging is owner-only (agents can't merge PRs here), and releases need owner approval too — both are requested in-thread already; once merged I'll cut the release PR if approved.
On the array form, "nothing is lost" doesn't hold for what the model reads. OpenCode's stored history has the full call, but the model only sees BILI's egress, and on 0.1.212 the request after an array-form fold carries neither copy:
There's no [Compressed conversation section] message in it. stripKernelSummaries only checks that the call is present, so it drops the render, and hideConsumedCompressCalls keeps the call but runs it through compactCompressText, which cuts the summary to SUMMARY_STUB_CHARS. Together they leave zero full carriers, the case your invariant rules out. #4032 doesn't touch this path.
If stub-only is intended, BILI's prompt disagrees: it says the summary "becomes the only record of the replaced conversation" and tells the model to read the summary parameter of past compress calls. If it isn't, the carrier check probably needs to look at the call after compaction.
The prompt also contradicts itself on format. The tool description asks for one plain string, but the per-summary budget note shows content: [{startId,endId,summary}, {…}], which steers models toward the form that loses the text.
You're right, and I owe a correction: my "nothing is lost" was wrong about what matters in your lane. Verified against code (v0.1.212 == master on this path):
Mechanism confirmed. Two shipped features cancel each other out:
hideConsumedCompressCalls stubs every retained compress call — including a just-made fold — to 200 chars (kernel/src/hide-consumed.ts:237-241). Its design comment assumes "the rendered acp_summary message already carries it".
Full text stays reachable only via search_context/decompress (kernel block) or your client's stored history — which the model cannot read; it sees bili's egress bytes. The practical defect: a 200-char stub silently masquerades as the summary, while the prompt says otherwise ("the summary you write becomes the only record of the replaced conversation" — kernel/src/compression-rules.ts:40; "their summary parameter contains MODEL-GENERATED summaries" — kernel/src/compress-tools.ts:217). The model may believe it holds the record and skip decompress.
Related finding: open PR #4410 normalized "zero acp_summary markers in steady-state plugin sessions" as expected, justified by "the full summary text rides in the re-sent call arguments" — a premise the stubbing invalidates. Flagged there as an interaction needing joint adjudication.
Format contradiction — partially confirmed. The advertised schema/description is line-form-only since #4252 (compress-tools.ts:81-93). I could not find an array example in the per-summary budget note itself (src/compress-tool.ts:753 — it points to the tool description); if you can share the exact note text you saw, I'll pin the surface. What DOES still teach array form today: the kernel ACP text/hybrid protocol examples (compress-tools.ts:257/261/328/332), EXTERNAL_SUMMARY_NOTE (src/external-summary-surface.ts:6, visible in external-summary mode), and host failure lectures (src/stream.ts:1009/1025). While the array/line end-state asymmetry exists, those examples steer models toward the lossier path.
A (recommended): completeness-aware anchor strip — strip the render only when the post-compaction call still carries the exact full summary, otherwise keep it. Array-form converges to the same "stub + full render" steady state line-form gets post-[PR] fix(kernel): stub plain-text line-form compress calls in consumed-call cleanup (#3975) #4032: exactly one full copy per request, deterministic render ⇒ prefix-cache friendly. Cost: one full render per turn (what proxy-mode sessions already pay).
B: accept the stub-only steady state, but mark stubs explicitly (truncation marker) + prompt update routing the model to search_context/decompress, plus aligning the residual array-form examples to line form. Cheapest tokens; relies on model behavior.
Not folded into #4032: opposite direction (that PR removes redundant copies; this restores a missing one), and it's a load-bearing wire-behavior decision that stays owner-gated. #4032 itself is unchanged: rebased onto current master, CI fully green (head e8fc736), awaiting owner review/merge.
Bookkeeping close-up for the finding above: issue #5866 is filed and labeled bug + opencode + scope/wiring + p2 (wiring: the strip/stub interaction lives at the host egress layer; p2: no data loss — full text stays recoverable via decompress — but the model-facing record is silently truncated while the prompt claims otherwise). It carries the 来源 marker back to this issue, the cross-link to PR #4410 whose "full text rides in the re-sent call arguments" premise the stubbing invalidates, and the A/B decision options for the owner.
Nothing else outstanding on my side from your two reports: #4032 remains rebased onto current master with CI fully green (head e8fc736), awaiting owner review/merge; the zero-carrier question (#5866) awaits the owner's A/B decision before anyone implements. If you can share the exact budget-note text you saw with the array example, I'll pin that surface in #5866.
Activity
[-]MCP compress 的纯文本 content 未被简化,导致完整摘要重复保留[/-][+]The plain text content of MCP compress is not simplified, causing the full summary to be redundantly retained. | MCP compress 的纯文本 content 未被简化,导致完整摘要重复保留[/+]ranxianglei commentedon Oct 20, 2026
(ai: vllm-qwen/qwen3.8-27b)
查重:不重复。 按「consumed-call 清理 / 纯文本 content / acp_summary 重复保留」等关键词检索 open+closed issue 与 PR,无同症状同机制条目。
标签:bug + scope/kernel + p2。 缺陷类;根因在 kernel 的 consumed-call 清理(hide-consumed);能正常使用但清理机制对纯文本格式失效、重复摘要长期驻留历史(有界但不收敛),属 p2。客户端标签不打——MCP shim 是多宿主共用面,issue 未指向具体宿主,不瞎猜。
审核结论(先验证后动手):
kernel/src/hide-consumed.ts的parseCallText(line 41)只处理content为对象数组、或序列化为 JSON 数组的字符串;纯文本行式 content 走JSON.parse失败分支后直接返回 null。后果链:quotedRangeKeys为空 →resolveFate判 orphan → 落入 KEEP_LAST_ORPHANED=2 窗口;窗口内保留时rewriteCompressText/compactCompressText同样因解析失败返回 null,长摘要不会被截成 200 字符 stub,完整参数持续驻留。补充一点:裸名compress(proxy 车道)若用纯文本行式提交,同样不 stub——因为该路径按 callId 匹配命中 active 后永远保留,参数全文比 MCP 孤儿窗口更持久。属同一机制家族,一并修。src/server.ts:2101确实只收集裸名 compress,MCP 块(合成plugin_callId)的锚点因此不被 strip。但如你指出的边界:对象数组调用的长摘要已被截成 stub,kernel 全文摘要是唯一完整载体——把载体索引扩到 MCP 名只会删掉唯一全文,造成数据丢失。所以修复不动 carrier 索引,让纯文本调用走与对象数组完全相同的结局:参数截为 stub + kernel 摘要保留全文。每个活跃块处理后至少一份完整摘要(期望 2/3 满足),且不再凭调用存在删 kernel 全文。parse-compress-input.ts的splitLineEntries/parseLineEntry,含 ref 规范化),compress: literal backslash-n in string content still fails as kind=content-not-array, hiding the real missing-summary reason #3780 已确立「共享归宿在 kernel」的先例。让 hide-consumed 复用同一套行式解析做范围识别与 stub 重写,不在 host 侧复制第二份格式实现。边界声明: 本修复触碰
kernel/(hide-consumed + parse-compress-input 导出一个行式解析 helper),PR 将带kernel-change:声明、commit 用kernel:前缀,按 Kernel Boundary 走人工审查档。回归测试覆盖:纯文本全活范围、对象数组(防回退)、部分范围失效、全死范围、失败折叠孤儿窗口、stringified-JSON 数组形态。开始实现,完成后带 PR 链接回复本线程。
ranxianglei commentedon Oct 20, 2026
(ai: vllm-qwen/qwen3.8-27b)
修复完成,PR:https://github.com/ranxianglei/billion-context/pull/4032(Closes #3975,已按 PR 描述声明
kernel-change,kernel 变更走人工审核层级)。八问
m00100–m00120 主题、其余行是摘要),但出站历史的 consumed-call 清理器只认对象数组。纯文本格式的调用解析不出任何引用范围,被误判为 orphan,落进「最近两个 orphan 保留窗口」且永远不被截断,于是调用参数里的完整摘要与 kernel 的 acp_summary 长期双份保留。kernel/src/hide-consumed.ts的parseCallText对字符串 content 只做一次内层 JSON.parse,不是数组就放弃(返回 null);而纯文本格式正是 compress 工具在「非 JSON 数组」时走的正式接受路径(parse-compress-input.ts的 splitLineEntries/parseLineEntry)。清理器与工具的接受面不对称——这是根因。附带发现同一机制也影响裸名 proxy 车道:id 命中的纯文本调用此前也永远保留全文。parseLineContent(stripJsonWrapperResidue → splitLineEntries → parseLineEntry),hide-consumed 对「内层非 JSON 数组」的字符串 content 走它取归一化范围键(与块存储的 ref 形态对齐)。之后纯文本调用与对象数组完全同路径:按范围判活/死、长摘要截成 200 字符 stub、头行逐字保留、字符串形状保持。刻意不扩大 buildCarrierIndex:截断后的参数不是完整载体,若凭调用存在就删 kernel 全文会丢全文(即你指出的边界)——终态是「参数 stub + acp_summary 作为唯一完整载体」,与今天对象数组车道的终态一致。不可解析的垃圾串保持逐字节不变。行为变更披露(旧→新):纯文本格式 compress 调用的渲染参数,长摘要由「永久保留全文」变为「截为 200 字符 stub」(MCP 车道与裸名车道同时生效);此类调用的命运判定由「恒为 orphan」变为「按引用范围判活/死」。这是本 issue 期望 1 的直接实现,非意外漂移。
已有历史会话中重复保留的调用参数会在下次该会话出站渲染时被同一清理器处理掉,无需迁移。CI 状态我随后跟进确认。
kernel: stub plain-text line-form compress calls in consumed-call cle…
test: pin MCP-lane end state for line-form compress cleanup (#3975)
ranxianglei commentedon Oct 20, 2026
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)
补充一条进度说明:在我上一条评论之后,master 合入了 #3769(orphan 处理从「保留最近两个」的轮转改为「只在真实 fold 之后清扫」)。PR #4032 已 rebase 到最新 master,内核测试按新语义适配,修复本身与最终保证不变:
acp_summary锚点保留策略不变——它仍是唯一完整载体。本地验证:kernel 全量 1407/1407、typecheck 干净、bili 定向 25/25。等 CI 全绿后这里同步结论。PR: #4032
kernel: stub plain-text line-form compress calls in consumed-call cle…
test: pin MCP-lane end state for line-form compress cleanup (#3975)
ranxianglei commentedon Oct 20, 2026
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)
CI 状态说明:rebase 后第一轮 CI 有 4 个 test shard 红,逐一核对日志后确认全部是 master 上已存在的偶发测试,与本 PR 无关:
upgraded pre-fold-gate state keeps rotation-hidden orphans hidden end-to-end (#3769)(ubuntu 22/1、windows 22/2)bare-id loadSync hydrates a pooled envelope when the unified index misses (#3769 flake)(ubuntu 22/2、windows 22/1)证据:master 当前 head
bc4a3f87e自己的 CI(run 39460567882)就是同样的 5 个 shard 红、同样的两条测试签名;本 PR diff 不触碰 storage/loadSync 路径;本地在 PR head 上定向跑该 e2e 测试通过。失败 shard 日志里还有 sqlite 锁争用迹象(handle may stay locked)。处置:已触发 rerun-failed-jobs(等结果);这个 red-master 偶发家族没有现成跟踪项,已按规范单独立项 #4041(带来源标记与完整证据),不混入本 PR。其余所有 gate(kernel-guard / version-guard / lock-sync / docs / lane-guard 等 27 项)全绿,lock-sync 之前红过一次是因为内核版本 bump 漏了 kernel/package-lock.json 再生成,已修进 kernel commit。
ranxianglei commentedon Oct 20, 2026
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)
收工报告 — 修复完成,PR:https://github.com/ranxianglei/billion-context/pull/4032(`Closes #3975
,已声明kernel-change:`)八问:
content(首行m00100–m00120 主题、其余行摘要),但 consumed-call 清理层不认这种格式——调用参数里的完整摘要永远不被简化,与 kernel 的acp_summary全文重复保留。kernel/src/hide-consumed.ts的parseCallText只解析对象数组与「序列化成 JSON 数组的字符串」;纯文本字符串落入 orphan 分支,而 orphan 保留路径的改写函数对无法按条目解析的参数直接放弃(返回 null),完整正文就一直留在出站历史里。根因是格式覆盖缺口(工具入口parse-compress-input.ts认纯文本、清理层不认),不是清理策略错误。parse-compress-input.ts导出parseLineContent(规范化 refs + 逐条目解析),hide-consumed.ts用它在三种既有分支之外补上纯文本分支:fate 判定(按引用范围匹配活跃块)、存活条目 stub(≤200 字符)、失效条目剔除,全部与对象数组同路。刻意不扩大buildCarrierIndex的工具名/格式匹配来删 kernel 全文:stub 不是完整载体,删了锚点就丢全文(issue 期望 Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 的红线)。终态 = 纯文本 ≡ 对象数组:参数 stub、kernel 摘要为唯一完整载体。acp_summary锚点保留行为不变。本地:kernel 全套 1407/1407、bili 定向套件 25/25、typecheck 干净。CI 现状:PR 的全部 gate(kernel-guard / version-guard / lock-sync / docs / lane-guard 等 27 项)绿;test shard 被 master 自身的红风暴卡住(master run 39460567882 与 PR 三轮共 19/19 shard 次挂同样的两条存储水合测试签名,本地 18 次并行压测无法复现,日志有 ENOSPC 磁盘压力证据)——已单独立项 #4041 跟踪并附完整证据,与本 PR 无关。
合并判定:代码侧收工,等 CI 风暴过去后即为可合状态;因含
kernel/变更,按 Kernel Boundary 走人工 review 档,请 owner 审阅后自行合并。kernel: stub plain-text line-form compress calls in consumed-call cle…
test: pin MCP-lane end state for line-form compress cleanup (#3975)
12 remaining items
fix(#3975): recognize observed mcp__client__compress bridge dialect i…
ranxianglei commentedon Nov 5, 2026
(ai: vllm-qwen/qwen3.8-27b)
CI 已全绿(PR head
38fd9ac91):16 success / 14 skipped / 0 failure,含 ubuntu+windows × node 22/24 全部 test shard 与 lock-sync 门禁。期间修掉一个我自己 rebase 时引入的 lockfile 格式问题(kernel/package-lock.json 两字段被挤到同一行,norm 后与 CI 期望逐字节一致),已折进对应 commit,diff 保持干净(全 PR 共 10 文件)。当前状态:
mcp__client__compress方言识别(host)+ 回归测试;darkness-A commentedon Nov 5, 2026
Correction to my previous comment — the
mcp__client__compresswhitelist entry is not needed for our lane.I mislabeled the tool name.
mcp__client__compressis how our own gateway (sitting downstream of bili, between bili and the Anthropic API) re-exposes client tools upstream. The request bili actually sees from OpenCode carries the bare built-in namecompress(bili's proxy-injected tool), so the existing predicates already match it. Our gateway's own tool-batch records confirm the names it receives from bili are exactlycompress/decompress.Evidence that the parsing fix alone is sufficient on this lane: I applied a local patch to the shipped v0.1.212
dist/index.jsequivalent to #4032's original fix (parseCallTextfalls back to the built-insplitLineEntries/parseLineEntryfor plain-text line-form content;serializeCompactedkeeps line form with the 200-char stubs;quotesActiveBlockrecognizes the same form) — no name whitelist change.tool_use.inputfor the past compress calls.So please consider dropping the
mcp__client__compressentry from the PR: it is not exercised by any real traffic we have, andclientis a generic MCP server name, which is the same misidentification risk you rejected for suffix matching (#2578). Sorry for the noise.Heads-up for gateways (not a bili bug, FYI): stubbing rewrites the
inputof an already-executedtool_usein history. Gateways that match history exactly can see that as "same tool id, different arguments". Ours rejected it once, at the turn where a just-made compress call was still awaiting its result; we now degrade it to a cold rebuild on our side. It is also a one-time prefix change, so there will be one cache rewrite per session when the fix rolls out. Keeping the stub deterministic and stable across turns (which it is today) is what matters.更正上一条评论:我们这条链路不需要
mcp__client__compress白名单。我把工具名写错了。
mcp__client__compress是我们自己的网关(位于 bili 下游,在 bili 和 Anthropic API 之间)转发上游时给客户端工具起的名字。bili 实际从 OpenCode 收到的是 bili 代理自己注入的裸名compress,现有谓词本来就能识别。网关的工具批次记录也证实,从 bili 收到的工具名就是compress/decompress。只修解析就够了的证据:我在已发布的 v0.1.212
dist/index.js上打了一个本地补丁,与 #4032 最初的修复等价:parseCallText遇到纯文本行式内容时,改用内置的splitLineEntries/parseLineEntry解析;serializeCompacted输出保持行式,摘要截成 200 字符短稿;quotesActiveBlock也能识别这种形式。名字白名单没有改动。建议从 PR 中去掉
mcp__client__compress这一条。我们没有任何真实流量会用到它,而且client是很常见的 MCP server 名,误认风险和你们拒绝后缀匹配(#2578)的理由是一样的。抱歉带来干扰。给网关的提示(不是 bili 的 bug,仅供参考):截短会改写历史里已执行过的
tool_use的input。严格逐字比对历史的网关会把它看成"同一工具 id,参数却变了"。我们的网关在"刚调用完 compress、还在等结果"的那一轮拒绝过一次,现已在我们这边降级为冷重建。另外,这是一次性的前缀变化,修复上线时每个会话会有一次缓存重写。关键是截出来的短稿要确定且逐轮稳定,目前已经是这样。ranxianglei commentedon Nov 5, 2026
(ai: vllm-qwen/qwen3.8-27b)
感谢更正,这个锅我认——我只信了工具名标签,没有追问改名发生在哪一层。按你的建议已全部处理:
已做
mcp__client__compress白名单 commit 已整体撤掉(不是只删配置行:谓词、lockstep twin、相关测试行全部回退),PR 回到纯解析修复的形状,head72f710333已重新推送;client是通用 MCP server 名(与 [Bug] MCP 模式下 acp_rule 的工具名带有前缀,可能导致硬保护失效 #2578 拒绝后缀匹配同一风险)而放弃」的决策过程,避免后人再走一遍弯路;你这份验证数据(离线 8 个真实调用 48,425→5,569 字符、重启后线上请求即带 stub)也写进了 PR 描述作为现场验证。网关提示收到(确认不是 bili 的问题):stub 是确定性的且逐轮稳定——这条已有测试钉住(stub fixpoint stability pin),上线时每个有历史行式调用的会话会有一次性缓存前缀重写,这一点也已写进 PR 的行为变更表;你们对「compress 刚发出还在等结果」那轮的拒绝已在网关侧降级为冷重建,bili 侧无需动作。
一个诚实的技术差异说明:你的本地补丁同时让
quotesActiveBlock认行式格式,而本 PR 刻意没有扩展它——宿主侧的载体索引(buildKernelSummaries/carrier index)同样不解析行式,所以acp_summary锚点继续作为唯一完整载体保留,两侧保持一致;对你这条链路没有影响——裸名调用是按 id 匹配的,stub 改写不依赖范围解析。状态:新 CI 正在
72f710333上跑(全套约 15 分钟),结果出来我会补一句。合并与发版需要 owner 批准(agent 不能自行合并);如果 owner 同意,合并后我可以提 release PR。ranxianglei commentedon Nov 5, 2026
(ai: vllm-qwen/qwen3.8-27b)
CI 终态 + 收工结论
PR #4032 最终 head
e8fc736ba(解析修复 + ci-fixes 同步)全矩阵绿(run 41952551785,0 failure)。此前的红是 3 条 hermetic-proxy timing flake(两个文件在我 head 与干净 master 上本地均可复现绿,与本 diff 无关;ci-fixes 的 lag-aware teardown 落地后消失,细节在 #4599)。PR 最终形态:纯解析修复——
parseCallText复用 compress 自己的验收阶梯(parseLineContent)识别纯文本行式 content,此类调用按范围归入 active/inactive 并统一截成 200 字符 stub;kernel 0.0.180→0.0.181,新增回归测试 14 个。白名单条目已按你的更正撤掉。八问:
parseCallText只认对象数组/JSON 数组字符串,行式 content 返回 null → 调用落入 orphan 处理,rewrite/compact 两条路都整体跳过;compress calls rejected when the summary text rides incontentnext to top-level startId/endId — plus U+2212 dash silently folds the wrong range #4252 之后 schema 只宣传行式,长会话迟早撞上。收工判定:代码侧完成,PR #4032 等 owner 人工 review(kernel 变更,Kernel Boundary 人审档)与合并;合并后请批准一个 release(下一个 patch)让它上车——更新后重启即恢复你的车道(伴随一次性缓存重写)。
onlyonec commentedon Nov 7, 2026
Still happening on 0.1.212 in the OpenCode 2 plugin lane (
./server, tool namecompress).I folded one range through
/__bili/plugin/toolon a throwaway daemon, then resent the history with the client's compress call:content(what the schema asks for): the full summary goes out twice on every later request, once as BILI's[Compressed conversation section]render and once in the call arguments.content: the call gets cut to a 200-char stub and the render is stripped too, so no full copy reaches the model at all. The array form isn't a safe workaround in this lane.In a long session this is about 36k tokens per request, and each fold makes the provider bill the duplicate uncached.
#4032 looks right for this lane as is: once it stubs the line-form call,
buildCarrierIndexstill can't parse that call, so the render stays as the one full copy. If someone later teachesbuildCarrierIndexorreconcilePluginFoldCallIdsthe line form, the plugin lane ends up where the array form is now, with the stub and no summary.Could #4032 get rebased and merged?
ranxianglei commentedon Nov 7, 2026
(ai: vllm-qwen/qwen3.8-27b)
Thanks for the lane-specific data — I verified all three points against the v0.1.212 code (identical to current master for these paths; the v0.1.212→master diff of
src/server.tsdoesn't touch the carrier index).Line-form double-send (first bullet): confirmed — this is exactly the mechanism #4032 fixes, and your end-state analysis holds: once the call is stubbed,
buildCarrierIndexstill can't parse line-form args, so the render stays as the one complete copy.Array-form "no full copy reaches the model": verified as mechanics, but this is shipped by-design behavior, not a bug (#1567 carrier handoff). In the plugin lane the contract makes the client's own re-sent tool-call pair the summary carrier:
stripKernelSummariesstrips the redundantacp_summaryrender only while that pair actually rides the post-prepare history and range-matches the block (src/server.ts:2730-2732) — if the pair were pruned or absent, the anchor is kept, so an active fold never ends with zero carriers. The full text isn't lost: it persists in OpenCode's stored history (re-sent verbatim every turn — your repro proves its presence, since the strip requires the range match) and in the kernel block (decompress restores it). The model saw the full summary on the fold turn itself; a stable 200-char stub afterwards is the intended lean steady state, same as every other correctly-working plugin lane. So "not a safe workaround" is a misread — nothing is lost, it just isn't re-sent.One honest asymmetry: post-#4032, line-form blocks keep their standing render (one full copy per request) precisely because the index can't parse them — the fail-safe direction. So in your lane, line-form will cost more per request than array-form until someone teaches the carrier index the line form.
Forward constraint: recorded. I added a design note to the PR body — teaching
buildCarrierIndex/reconcilePluginFoldCallIdsthe line form moves line-form blocks to the same stub-only steady state, which is acceptable only while ≥1 complete carrier survives (client-side pair / decompress); no variant may ship where neither the stubbed call nor the render carries the full text.Status: #4032 is already rebased onto current master and CI is fully green (run 41952551785, head e8fc736). Merging is owner-only (agents can't merge PRs here), and releases need owner approval too — both are requested in-thread already; once merged I'll cut the release PR if approved.
kernel: bump acp-kernel to 0.0.184 for the #3975 line-form stub (post…
onlyonec commentedon Nov 7, 2026
On the array form, "nothing is lost" doesn't hold for what the model reads. OpenCode's stored history has the full call, but the model only sees BILI's egress, and on 0.1.212 the request after an array-form fold carries neither copy:
There's no
[Compressed conversation section]message in it.stripKernelSummariesonly checks that the call is present, so it drops the render, andhideConsumedCompressCallskeeps the call but runs it throughcompactCompressText, which cuts the summary toSUMMARY_STUB_CHARS. Together they leave zero full carriers, the case your invariant rules out. #4032 doesn't touch this path.If stub-only is intended, BILI's prompt disagrees: it says the summary "becomes the only record of the replaced conversation" and tells the model to read the summary parameter of past compress calls. If it isn't, the carrier check probably needs to look at the call after compaction.
The prompt also contradicts itself on format. The tool description asks for one plain string, but the per-summary budget note shows
content: [{startId,endId,summary}, {…}], which steers models toward the form that loses the text.kernel: bump acp-kernel to 0.0.185 for the #3975 line-form stub (mast…
ranxianglei commentedon Nov 7, 2026
(ai: vllm-qwen/qwen3.8-27b)
You're right, and I owe a correction: my "nothing is lost" was wrong about what matters in your lane. Verified against code (v0.1.212 == master on this path):
Mechanism confirmed. Two shipped features cancel each other out:
hideConsumedCompressCallsstubs every retained compress call — including a just-made fold — to 200 chars (kernel/src/hide-consumed.ts:237-241). Its design comment assumes "the rendered acp_summary message already carries it".stripKernelSummariesruns AFTER that (src/server.ts:2667) and strips the render whenever a range-matching barecompresscall rides the history (plugin mode: in-place acp_summary never stripped when the client's own compress pair rides inbound — double summary carrier on every post-fold turn #1567 carrier handoff) — checking presence + range match only, never whether the call still carries the full text. Stubbing preserves startId/endId, so the match still hits → anchor stripped. Net: stub + no render = zero full carriers on the wire. Your live capture matches this exactly.Full text stays reachable only via search_context/decompress (kernel block) or your client's stored history — which the model cannot read; it sees bili's egress bytes. The practical defect: a 200-char stub silently masquerades as the summary, while the prompt says otherwise ("the summary you write becomes the only record of the replaced conversation" — kernel/src/compression-rules.ts:40; "their summary parameter contains MODEL-GENERATED summaries" — kernel/src/compress-tools.ts:217). The model may believe it holds the record and skip decompress.
Related finding: open PR #4410 normalized "zero acp_summary markers in steady-state plugin sessions" as expected, justified by "the full summary text rides in the re-sent call arguments" — a premise the stubbing invalidates. Flagged there as an interaction needing joint adjudication.
Format contradiction — partially confirmed. The advertised schema/description is line-form-only since #4252 (compress-tools.ts:81-93). I could not find an array example in the per-summary budget note itself (src/compress-tool.ts:753 — it points to the tool description); if you can share the exact note text you saw, I'll pin the surface. What DOES still teach array form today: the kernel ACP text/hybrid protocol examples (compress-tools.ts:257/261/328/332), EXTERNAL_SUMMARY_NOTE (src/external-summary-surface.ts:6, visible in external-summary mode), and host failure lectures (src/stream.ts:1009/1025). While the array/line end-state asymmetry exists, those examples steer models toward the lossier path.
Filed: #5866 with options for the owner:
Not folded into #4032: opposite direction (that PR removes redundant copies; this restores a missing one), and it's a load-bearing wire-behavior decision that stays owner-gated. #4032 itself is unchanged: rebased onto current master, CI fully green (head e8fc736), awaiting owner review/merge.
ranxianglei commentedon Nov 7, 2026
(ai: vllm-qwen/qwen3.8-27b)
Bookkeeping close-up for the finding above: issue #5866 is filed and labeled
bug+opencode+scope/wiring+p2(wiring: the strip/stub interaction lives at the host egress layer; p2: no data loss — full text stays recoverable via decompress — but the model-facing record is silently truncated while the prompt claims otherwise). It carries the 来源 marker back to this issue, the cross-link to PR #4410 whose "full text rides in the re-sent call arguments" premise the stubbing invalidates, and the A/B decision options for the owner.Nothing else outstanding on my side from your two reports: #4032 remains rebased onto current master with CI fully green (head e8fc736), awaiting owner review/merge; the zero-carrier question (#5866) awaits the owner's A/B decision before anyone implements. If you can share the exact budget-note text you saw with the array example, I'll pin that surface in #5866.
chore(kernel): bump 0.0.185→0.0.186 — max+1 over master (#5867 took 0…