Repository navigation
[PR] Stop advertising compress tools on plugin rounds that don't declare them (pi round-1 fix) - #5009
ranxianglei wants to merge 16 commits into
Conversation
…4998) Round 1 of a pi native session ships without bili's ACP tools: the pi extension registers them host-side in an async before_provider_headers handshake that lands after pi has already built that round's payload, while the ownership headers are stamped. In plugin mode the proxy never injects tools (the host owns the tool table), so a cold-start round-1 payload can legitimately lack compress & co. The lane decision still advertised the full standing compress prompt for pi/omp/opencode via the profile default toolsHostScopedByDefault=false, telling the model to call a tool that is not in its own request. Make reachability purely observational per request (declaredTools contains compress / mcp__bili__compress / a code-mode omnibus tool), drop the dead profile field, and keep the headerless zombie clause so #2155 self-heal probes stay armed. Behavior change: plugin rounds whose body declares no bili tools now get the tags-only prompt instead of the standing compress prompt (and lose nudge eligibility). Healthy steady-state sessions declare their tools every round and are byte-identical. Tests: lane-decisions-matrix rows flipped to observation semantics with positive+negative pairs (#3617); new pi headerless-zombie row; EMERGENCY row and positive fixtures now co-declare a host tool — a bili-only table is a side request that #1897 demotes before lane judgment; issue4344 unit/chain updated; plugin-nudge-injection healthy-lane fixtures now declare tools.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9226-pr.5009.6c9e74cThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5009.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。与已关闭的 #1243 / #2708 同属「插件回合缺 ACP 工具」家族但机制不同——#1243 = origin 发现竞态导致请求头根本没打上;#2708 = 工具注册后被注册表重建丢弃;本条(#4998)= 冷启动第一轮「头已打上、工具异步注册尚未落库」,是第三种独立成因。修复方向与前两条一致(可达性按请求观测、不按 profile 名假设),收敛到同一纪律,不冲突。 标签:底层 bug issue #4998 已带 以下为独立审过 diff 后的结构化结论(未照抄 issue 措辞)。 ① 方向关(原 issue 审)
② 回归关(既有行为清点 —— 语义级改动,逐项过)diff 只动
③ 代码关
④ 测试有效性
⑤ diff 整洁度5 文件全与本 PR 目的相关(2 source + 3 test),无跑题文件、无 lockfile/生成物连带、无版本号变动、无批量空行重排。干净。✅ 八问结论
合并判定:代码审查五关(方向/回归/代码/测试有效性/diff 整洁)全过,可合。CI 现状:gate / static-gates / docs-coverage / lane-guard / mysql-contract 全绿、0 失败;ubuntu/windows × node22/24 的全量 test shard 仍在跑(pending 12)。等全量转绿我再补确认,红则定向排查。另注:此改动触及 wire 消息形态(无工具回合的 prompt/nudge 字节)与可达性默认,按 §7.4 属人工合并范畴、不适用 auto-merge——请 owner 拍板合入。 |
…eachability (#4998) #4998 made plugin compress-surface reachability observational per request. Three e2e fixtures model healthy steady-state plugin rounds but never declared the ACP tools, so their nudge/prompt observables went silent with the surface: - headroom-output-fallback (#971 pi-header rank scenario): the nudge is the test's observable for max-output precedence — the round now declares compress + a regular host tool like a healthy steady-state pi round. - issue2432-dsh-local-compaction (#2432 breaker-vs-nudge): the omp control and armed sessions declare their tools per round. - side-request-isolation (#1699 title-gen): the exact title-gen shape declares no bili tools, so its misclassified-as-main-turn control no longer carries the ~11KiB standing prompt — pin the new signature instead (main-turn rewrite via the tags-only slot, NO standing compress prompt). A bili-only tools table is a side request #1897 demotes before lane judgment, so every positive fixture co-declares a regular host tool (same pattern as the plugin-nudge-injection fixtures).
…ndows runners PR #5009 CI (windows-latest/node22, leg 2/5) failed the proxy-openai-sse and proxy-anthropic-sse abort tests after the 3s poll budget elapsed (closed=0), twice (original run + rerun-failed-jobs); the two lighter siblings (proxy-responses-sse, proxy-json) passed in the same shard, and this file is green on both ubuntu legs at this head and locally (standalone 2/2). This PR does not touch the teardown path (no src changes in the head's second commit; #4998's lane-decision change is inert for plain-proxy traffic — compressReachable short-circuits on !pluginMode), so this is async-propagation latency on a slow Windows runner, not a regression from this PR. Identical 4-line diff to in-flight PR #4683 (head 9dd31d2); if #4683 merges first, drop this commit on rebase. Documented flake family: #4599 floors 350/352/358/363/365.
(ai: vllm-qwen/qwen3.8-27b) CI 自动修复完成。通知引用的是旧 head 查重: 不重复 —— open+closed issue/PR 检索「wire-exit-matrix / abort teardown / closed=0」无其他条目处理本失败签名;flake 家族已在 #4599 协调总账在档(floors 350/352/358/363/365),在途修复 PR #4683,按在档口径处置、不新立项。 做了什么(两个独立 commit)
结构化八问
收工判定:head |
(ai: vllm-qwen/qwen3.8-27b) |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) |
(ai: vllm-qwen/qwen3.8-27b) 新 head 好消息:#5140 家族已被 #5188 修掉 —— 本轮 run 41067530040 六个 test 分片全部不再出现 剩余红仅 2 片、逐 job 日志取证全部是在档 Windows-only 继承红(floor 533/535,零交集本 PR diff):
八问要点(完整体例见上一条回复,此处只报增量):①问题 = 两 Windows 分片的既有继承红;②原因 = master/ci-fixes-tip 在档缺陷(#5188 修了 #5140 域,这三例不在其覆盖内);③影响 = 仅 CI 门禁面、Windows-only、运行时零影响;④处置 = PR 侧无可修项(不代修 master 级失败、不开新 issue——三家族均已在 floor 533/535 上报待 owner triage),收敛走哨兵/ci-fixes;⑤回归 = 无,本 PR 车道全绿且 #5140 修复未波及;⑥缓存不涉及;⑦设计方向不变;⑧无新配置。 收工判定:PR 代码 ready-to-merge,硬阻塞从「五家族」收窄到「三个 Windows-only 在档家族」,等其 triage/ci-fixes 收敛后自动转绿。合并留给 owner。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Merge-guard sync done (round 3): master advanced |
…flict sync) Resolves 2 conflicts, both in test files: - tests/wire-exit-matrix.test.ts: take master's awaitUpstreamTeardown helper (from #4683, now merged) over this branch's inline 6s poll loop — same intent (slow-runner teardown budget), helper is the converged shape. - tests/lane-decisions-matrix.test.ts: union — master's extended ROWS type (location/onlyWires from #5527) + this PR's omp row pinning observed reachability (toolless omp round goes silent, #4998). Typecheck clean; targeted suites green (lane-decisions-matrix, wire-exit-matrix, plugin-nudge-injection, issue4344-mcp-dialect: 129/129).
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决并推送:head 过程要点(含一个本地环境坑):
结构化八问
当前实况(本 run 实测,非转述):GitHub API |
(ai: vllm-qwen/qwen3.8-27b) 进度汇报(重启后状态确认):本轮工作已在重启前完成并汇报(见上条 floor 99 的完整八问),重启发生在回复发出之后,无未完成动作。
|
[ework] CI fix verified green ✓ |
[bot] (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 —— 本 PR 是 #4998 的修复(服务端可达性面),与已关闭的 #1243(origin 发现竞态,请求头根本没打上)/ #2708(工具注册后被注册表重建丢弃)同属「插件回合缺 ACP 工具」家族但机制不同(本条 = 冷启动第一轮「头已打上、工具异步注册尚未落库」);与 #5465(客户端面,pi/omp 从第一轮就声明工具表)零文件重叠、互补。 以下为独立审过 diff 后的结论(未照抄 issue 或前序 review 措辞,八问与判定由我重新推导)。 ① 方向关(原 issue #4998)
② 回归关(既有行为逐项清点)diff 只动
③ 代码关
④ 测试有效性
⑤ diff 整洁度8 文件全与本 PR 目的相关(2 source + 6 test),无跑题文件、无 lockfile/生成物连带、无版本号变动、无批量空行重排。干净。✅ 八问结论
合并判定:代码审查五关(方向/回归/代码/测试有效性/diff 整洁)全过,可合。CI 现状(镜像缓存实测,head |
Closes #4998
What & why
Round 1 of a pi native session advertises NO bili ACP tools while already carrying the full
x-bili-plugin*ownership header set: the pi extension registerscompress/decompress/search_context/acp_statushost-side in an asyncbefore_provider_headershandshake (src/agent/pi.tsregisterTools → fetchManifest), which lands AFTER pi has already built that round's payload. Round 2+ carries the tools.Verified with a local repro of the reporter's method (fake OpenAI-compatible upstream, real pi CLI through this repo's build): request 1's tools array has zero ACP entries, request 2 has all four, headers identical on both requests.
In plugin mode the proxy never injects tools (the host owns the tool table, KDD #7/#162), so a round-1 payload without the tools is legitimate host behavior — but
resolveLaneDecisionsstill turned the model-side compress surface ON unconditionally for pi/omp/opencode via the profile defaulttoolsHostScopedByDefault=false. Reproduced byte-for-byte: round 1 sent the FULL standing compress prompt telling the model to callcompress, while its own request had no such tool — the same "advertise what you can't call" defect class that #3177/#3401 fixed for dsh and #4344 for zcode.Fix
Reachability is now purely OBSERVED per request:
compressReachableinsrc/server/lane-decisions.tsdrops the profile-default escape hatch and keeps only the observational terms (declaredcompress, MCP-dialectmcp__bili__compress, code-mode omnibus tools) plus the headerless zombie clause (#2155/#4372 self-heal probes stay armed). The now-deadtoolsHostScopedByDefaultfield is removed fromsrc/host-profiles.ts(interface + all profiles + ANONYMOUS).Behavior change (old → new)
Tests (regression pins)
tests/lane-decisions-matrix.test.ts: rows flipped to observation semantics with positive+negative pairs per Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 — pi/omp/opencode no-tools → surface OFF; each lane declaringcompress(+ a regular host tool) → ON; NEW pi headerless-zombie row (headerless sticky rounds keep the surface ON so the self-heal probe stays armed); EMERGENCY override row updated. Positive fixtures co-declare a host tool because a bili-only tools table is a side request that OMP extension injects tools and compression philosophy in helper prompts #1897's leak guard demotes before lane judgment (real pi traffic always co-declares its action tools).tests/issue4344-mcp-dialect.test.ts: unit pi sub-case now pins mcpDialect observability on pi too; chain negative control uses a declared-tools healthy round.tests/plugin-nudge-injection.test.ts: 0.1.69 回归: plugin 模式 nudge 注入被 !pluginMode 静默禁用 — INJECT 日志照打但从不投递, 自动压缩只剩 preflight 应急 #451 plugin-nudge and billion-context 0.1.197 在 DeepSeek Harness(DSH)0.2.0-rc.2 里反复抛出 Error: unknown tool "compress"。 工具注册落在了错误的作用域 #3177 standing-prompt differentials now use tools-declared fixtures for the healthy lane (the dsh toolless negative direction is unchanged).Local verification: typecheck clean, build green, targeted suites green (lane-decisions-matrix + issue4344-mcp-dialect + plugin-nudge-injection + issue1206-thirdparty-scan = 158/158 pass). Full suite via CI.
查重: 无 — 与已关闭的 #1243 / #2708 同家族但机制不同(#1243 = origin 发现竞态、请求头根本未打上;#2708 = 工具注册后被注册表重建丢弃;本条 = 冷启动第一轮"头已打上、工具尚未注册"),详见 issue 首评。
Companion facet: PR #5465 (#5459) moves pi/omp tool registration ahead of round 1 client-side; this PR keeps the server-side invariant — never advertise a compress surface a given request cannot call — independent of client registration timing. No file overlap; merge order independent.