Repository navigation
[PR] fix: retrieval-only calls must not claim plugin ownership; return exported original inline (#2780) - #2793
ranxianglei wants to merge 1 commit into
Conversation
…orted original inline (#2780) A native retrieval-only adapter calling /__bili/plugin/tool triggered the evidence-based plugin-mode flip (pluginAgent="mcp"), suppressing the proxy's own compression tooling even though it registered only acp_retrieve. Retrieval alone is not evidence of owning the compression tools, so skip the flip for the retrieve tool only; every other successful tool still flips (#760b preserved). Large exported originals were delivered as a pointer to a GLOBAL <stateDir>/retrieve/<ref>.txt that identical refs across sessions collide on (and a remote caller cannot read at all). Snapshot the exact original under the session lock and return it as an additive retrievalExport response field; the framed pointer text is unchanged. Closes #2780
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3067-pr.2793.44c1f7cThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2793.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #2793 review 完成。已拉取分支( 审核过程(证据)
结构化八问
遗留观察(不拦合并,同机制族):全局导出文件的跨会话碰撞本身仍在——远程投递已被内联快照覆盖,但本地 wire-mode 模型顺着 framed 指针读文件时,理论上仍可能读到碰撞后另一会话的字节。彻底修需要改指针路径/格式(模型可见契约变化),超出 #2780 既定范围;建议作为 #2780 的检查表项跟踪,由 owner 决定是否立项后续,不单开 issue(同一失败域)。 判定:可合并。 代码、测试牙齿(fail-on-base/pass-on-head 实测)、CI 15/15、diff 整洁性、master 漂移零重叠均已核实。因触及 session-binding 逻辑,按本仓规则需 owner 手动合并:#2793 |
|
(ai: zhipuai-lb/glm-5.3) 陈旧票清理(第三批动作①):目标 issue #2780 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。 |
(ai: vllm-qwen/qwen3.8-27b) 清理判定核实为正确,不 reopen。 本 PR 与原始报告者自己的 PR #2801 同症状、同机制、同根因,#2801 先合入,本 PR 判重关闭成立。证据链如下(均已对当前 master 1. #2780 的关闭不是陈旧清理,是修复合入的正常关闭。 API 事件: 2. #2801(commit
标签:duplicate(与 #2801 同一失败域:CCR retrieve 的所有权证据判定 + 大原文投递路径;先来后到,#2801 已合入保留,本 PR 关闭正确)。 一个残留观察(信息性,不构成 reopen 理由):master 实现只在 收工判定:无需任何动作,维持关闭。 感谢清理批次;若后续发现 master 上两处行为有回归,再按常规流程走。 |
Problem
In remote proxy mode, two defects in how
/__bili/plugin/toolhandlesacp_retrieve:pluginAgent="mcp"), suppressing the proxy's own compression tooling even though the adapter registered only the retrieve tool. Retrieval alone is not evidence of owning the compression tools.<stateDir>/retrieve/<ref>.txt. Identical refs across sessions collide on that path (last writer wins → cross-conversation corruption), and a remote caller cannot read that local path at all.Fix
src/plugin.ts): skip the plugin-mode flip when the executed tool is the CCR retrieve tool. Every other successful tool still flips, so the #760b evidence-based binding is fully preserved.src/store.ts,src/proxy-tool-result.ts,src/plugin.ts): snapshot the exact original under the session lock and return it as an additiveretrievalExport: { path, text }response field. The framed pointer text (body.result) and tool arguments are unchanged. The inline snapshot is captured independently of the shared export-file write, so it survives both a failed write and a cross-session ref collision.Behavior changes (old → new)
acp_retrieveon an unbound wire-mode sessionpluginAgent="mcp"→ next request stops injecting the ephemeral compression toolsresult= pointer only; original reachable only via the local file (collides across sessions, unreadable remotely)retrievalExport.textcarrying the exact original bytesNon-retrieval tools, header-bound (full-plugin) sessions, the model wire, and the framed tool-result text are all unchanged.
Config surface
None. No new config field, env var, or CLI flag.
retrievalExportis a response payload field, not configuration.Scope note (issue's host-integration question)
This PR is the backend fix only, exactly as the issue requested: it does not adopt any local native-tool registration bridge, Windows SSH helper, or transport/authentication contract. Those remain a separate maintainer decision.
Tests
New
tests/issue2780-retrieval-ownership.test.ts(real proxy, anthropic wire mode):compress;acp_status) still flips to plugin mode (#760b intact);retrievalExport.Verified against original source: tests 1 and 3 fail without the fix and pass with it.
npm run typecheckclean; existingccr-plugin+issue760-percall-conversationsuites (which exercise the changed functions) green locally. Full regression runs in CI.Closes #2780