Skip to content

[PR] fix: plugin manifest serves top-level promptPack tool descriptions (#3243) - #3247

Closed
ranxianglei wants to merge 3 commits into
masterfrom
2026-10-15_issue3243-manifest-prompt-pack
Closed

ranxianglei wants to merge 3 commits into
masterfrom
2026-10-15_issue3243-manifest-prompt-pack

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

(ai: vllm-qwen/qwen3.8-27b)

Closes #3243

What

The plugin manifest (GET /__bili/plugin/manifest, which all native lanes — pi/omp/dsh/opencode/MCP — register their tools from verbatim) served kernel-default tool descriptions regardless of compress.promptPack, while each request's system prompt already honored the full global → provider → model pack cascade. Any pack (even top-level) therefore left registered tool descriptions on the default surface while the system prompt switched to the pack's rules — the exact mismatch reported in billion-context-pi#650 (migrated here as #3243).

handlePluginManifest now takes an optional ToolPrompts surface and applies it to the ACP core tool arrays exactly like the wire injector (applyAcpToolOverrides, before the extras merge); the admin endpoint resolves it via resolveCompressSurfaceDetailed(opts.compress ?? {}).

Behavior change (old → new)

No new config fields or env vars; no wire/message-shape change (only description text inside existing tool schemas); no persistence change; no kernel/ change.

Tests

New tests/issue3243-manifest-prompt-pack.test.ts (server-level, real manifest endpoint):

  1. global promptPack: "lean" → lean descriptions + paramDescriptions served on all three wires (wiring-pin against resolveCompressSurface({promptPack:"lean"}), not a wording pin); with the fix stashed, test 1 fails (teeth verified via stash A/B).
  2. no pack → kernel-default descriptions unchanged (pins pre-existing behavior).
  3. route-level-only pack → manifest stays default (pins the dsh acp rule报错 #1192 conservative boundary).

Local targeted runs green: new suite 3/3, adjacent suites (prompt-pack-tool-prompts, compress-prompt-pack, ccr-plugin, wire-contract incl. manifest goldens) 47/47, typecheck clean. Full-suite verdict: remote CI on this head.

awork added 2 commits October 15, 2026 12:53
…3243)

handlePluginManifest now takes an optional ToolPrompts surface and applies
it to the ACP core tool arrays exactly like the wire injector; the admin
manifest endpoint resolves it from the global compress settings via
resolveCompressSurfaceDetailed. Registered plugin tools previously always
carried kernel-default descriptions regardless of compress.promptPack —
now they follow the top-level pack. Provider/model-level promptPack still
shapes per-request system prompts only (the manifest has no route/model
context, #1192 conservative boundary). Regression tests pin lean-pack
descriptions on all three wires, unchanged defaults without a pack, and
the route-level-only boundary.
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-15_issue3243-manifest-prompt-pack (d23197d)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3742-pr.3247.e5caba4

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr3247.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复。 open PR 里碰 promptPack 的只有 #1433(lean canary 提案)与 #2537(pi project trust 门控),都不涉及 manifest 工具描述面;已关闭的 #2335/#2337 是反向案例(代理侧 pack 只到工具描述、系统提示词没换),机制与本单相反。本 PR 目标(插件 manifest 从不应用任何层级 promptPack 的 toolPrompts)无并行修复。

审核开始。PR #3247(head 541d7d38,base master effd5442,mergeable)diff 共 5 文件:src/plugin.ts +11/-5、src/server/admin.ts +7/-2、CONFIGURATION.md / zh-CN 各 ±1、新增 tests/issue3243-manifest-prompt-pack.test.ts 158 行。CI 已绿大部分车道,3 条在跑(dsh lane / registry e2e ubuntu / docs-coverage)。正在独立重读 diff 与既有行为面,跑定向测试,CI 全绿后按八问给完整结论。

… timing

Observed flake while reviewing #3247: CI run 38683949356, shard
'test (windows-latest, 22, 2)' failed this test with 'first chunk
should have flowed through' — the fixed 2s wall-clock sleep expired
before the first byte arrived on the loaded runner; rerun of the same
job on the same head passed. Replace the fixed sleep with a bounded
poll (first byte or 15s deadline); all three assertions keep their
teeth (a real non-streaming bug still fails at the deadline).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Review 结论(独立审核,八问)

1. 是什么问题:plugin 模式(pi/omp/dsh/opencode/MCP)下,宿主从 GET /__bili/plugin/manifest 逐字注册的压缩工具描述从不跟随任何级别的 promptPack(连顶层都不跟)——system prompt 切到了 pack 规则,工具描述却留在 kernel 默认面,两个面不一致(billion-context-pi#650 原始报告,迁移为 #3243)。

2. 什么原因导致的:handlePluginManifest 根本没有接收 ToolPrompts 的入参——admin 端点从不解析 compress surface;而 wire 注入路径(src/server/inject.ts:63/68/77/102)一直走 applyAcpToolOverrides。两条路径不对称,manifest 这条漏了。

3. 影响范围与严重程度:仅影响配置了顶层 compress.promptPack 的 native plugin 用户——注册的工具描述与 system prompt 规则不一致(语义错配,非功能故障);未配 pack 的用户零影响(manifest 输出逐字节不变)。严重度:一致性缺陷。

4. 怎么修复的:admin 端点用 resolveCompressSurfaceDetailed(opts.compress ?? {}) 解析全局 surface,把 .surface.toolPrompts 传给 handlePluginManifest,对 anthropic/openai/responses 三条 wire 的核心工具数组套用与注入器完全相同的 withExternalSummaryTools(applyAcpToolOverrides(...))(extras 合并之前)。provider/model 级 pack 仍只作用于 per-request system prompt——manifest 是静态端点、请求前抓取、无模型上下文,这是结构性边界而非遗漏,已在 CONFIGURATION en/zh 写明。

5. 是否有回归问题:逐项清点过——① 无 pack 时 manifest 输出逐字节相同(undefined overrides → applyAcpToolOverrides 直接浅拷贝同引用,kernel/src/surface-config.ts:135-177 确认;测试 2 + wire-contract golden 钉住);② absorb/rule/retrieve 门控(#1192/#1271)逻辑未触碰,overrides 到不了 extras 数组;③ proxy/wire 模式未动(inject.ts/handle.ts 不在 diff 内);④ responses 恒 no-range 的 CCR 变体保留;⑤ 其余 admin 路由未动;⑥ 8 处既有测试调用点传 2 参、可选第三参 undefined,行为不变。未发现回归。

6. 是否破坏缓存:不涉及(无缓存/重试/游标/去重键路径)。

7. 是否改了设计方向:没有。只是把 plugin 面缺失的 surface 补齐到与既有 wire 面一致;"manifest 静态、只取顶层"的保守边界保持并文档化。

8. 是否引入了新的配置:没有(无新 env/config 字段)。

验证证据(全部独立重做,未照抄 PR 描述)

  • 本地定向:PR head 上 11 个相关测试文件 109/109 通过(新 suite + prompt-pack-tool-prompts/compress-prompt-pack/ccr-plugin/wire-contract/golden/absorb/rules/absorb-plugin/decompress-empty-range/issue2652)+ tsc --noEmit clean。
  • 测试牙齿独立验证:把 src/plugin.ts + admin.ts 回滚到修复前 → 新 suite 测试 1 立即失败、测试 2/3 仍过 → 恢复。回归测试确实复现原 bug。
  • CI(旧 head 541d7d3):41 个 check-run 全数核查——guard/static-gates/hermetic registry e2e/docs/build-artifact/全部 real-client lane 绿;主单测 12 shard 中 11 绿,1 红:test (windows-latest, 22, 2)。红因与本 PR 无关:tests/issue1452-socket-hardening.test.ts:405('first chunk should have flowed through')——固定 2s 墙钟 sleep 在高负载 runner 上等不到第一个字节(该测试耗时 62s,期间日志满屏并发实例噪声),纯时序 flake;同一 job 同代码 rerun 转绿,已确认。
  • flake 顺手修掉(几行级小修纪律):已在本分支补一个独立标注 commit d23197db3(test-only:固定 sleep 改为有界轮询 ≤15s,三个断言原样保留、真 bug 仍在 deadline 处失败),该文件本地 10/10 通过。新 head d23197db3 的 CI 正在跑。

行为变更披露(old → new)

  • plugin 模式注册工具描述:旧 = 恒为 kernel 默认(无论任何级别 promptPack)→ 新 = 跟随顶层 compress.promptPack(pack 的 toolPrompts 作用于四条 ACP 核心工具,三条 wire;absorb/rule/retrieve extras 不动)。有意变更,与 PR 描述一致,我独立核实无误。
  • proxy 模式、provider/model 级行为:均不变。

判定

代码审查通过,diff 干净(现 6 文件,新增行全部与本 PR 目的相关)、测试有牙且覆盖三个关键面(接线 pin / 默认回归 pin / #1192 边界 pin)。本 PR 属默认值/行为变更,按 §7.4 走人工合并层。待新 head d23197db3 的 CI 全绿即可合——预计全绿(flake 路径已被加固 commit 消除);若仍有红我会跟进排查后在评论区更新。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI 更新:新 head d23197db3(含 flake 加固 commit)的 41/41 check-run 全绿——包括之前红的 test (windows-latest, 22, 2) shard(此轮一次通过)。无红、无 pending。

按上一条评论的八问结论:可以合了,请人工合并(PR URL: #3247 )。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

已并入合并列车 #4572(master 合并,merge commit 保留原作者署名)。本 PR 关单收尾;回滚点为 #4572 单提交 revert。

@ranxianglei ranxianglei changed the title fix: plugin manifest serves top-level promptPack tool descriptions (#3243) [PR] fix: plugin manifest serves top-level promptPack tool descriptions (#3243) Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant