Repository navigation
fix: register manifest-advertised conditional tools in the opencode V2 lane (#2443) - #2444
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2772-pr.2444.b0884f6This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2444.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 已实现并开 PR:#2445(Closes #2443)。已 rebase 到当前 master,与 #2399 的 fork-adoption seam 在同一 hook 内做了干净 union(两者共存, 八问结论:
需人工审核(§7.4 load-bearing 工具面变更):本修复在同步 setup-time 那次之外第二次调用 判定:代码完成、定向验证通过、CI 待跑;因属工具面/load-bearing 变更,留人工 live-host 确认累积假设后合并——我不自行合并。 |
|
验证备注(关闭正文里的 §7.4 人工确认 flag): 二次 即本 PR「setup 同步注册基础集 + 首个路由请求后再发一次 transform 补增量」的结构安全,无需改动。测试版本 opencode v2.0.3(与 issue 环境 v2.0.24 同属 2.0.x)。详见 issue #2443 回复。 |
[bot] 🏷 两件事都处理了: ① 收到你的实证确认:二次 ② master 漂移冲突已解决:先用 git 独立核实了冲突属实(分支落后 master,且只有 验证(rebase 后的 head):typecheck 干净(exit 0); GitHub 状态:PR #2445 八问(本次为纯 rebase、无语义代码变更):
判定:冲突已解、定向验证全绿、 |
[bot] 🏷 收到,这条实证确认与上一条相同、已在上条回复里处理过:二次 当前状态(刚核对):PR #2445 头 |
…2 lane The opencode V2 lane registered only its static bundled list (5 core ACP tools + absorb) and never consulted the proxy's plugin manifest, so the conditional surface it advertises - acp_retrieve while CCR is armed, acp_rule while rules are on - was absent from the model tool catalog. With CCR enabled an [acp-stored] placeholder pointed at acp_retrieve as its restore path, but the tool was unreachable (retrieveCalls stuck at 0 while storedBytes grew); the only workaround was disabling CCR. Consume the manifest like the dsh/pi lanes already do: on the first routed request (when the proxy base becomes known) fetch GET /__bili/plugin/manifest and register whatever it advertises beyond the static set. Single-flight, inert-degrading (a failed fetch leaves the tools unregistered, same as before) with a retry cooldown. The always-on core keeps its exact bundled schemas; only the advertised delta is added. Closes #2443
4b1e030 to
410ea46
Compare
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.204-master.7201b45 # this exact build
npm install -g billion-context@master # always the newest merged build
|
What / why
The opencode V2 lane (
src/agent/opencode-v2.ts) registered only its static bundled list — the 5 core ACP tools +absorb— and never consulted the proxy's plugin manifest. That list has noacp_retrieve. So in plugin mode with CCR enabled, an[acp-stored]placeholder advertisedacp_retrieve("mNNNNN")as its restore path, but the tool was not in the model's catalog — an unreachable pointer.retrieveCallsstayed at 0 whilestoredBytesgrew; the only workaround wasccr.enabled:false.The dsh and pi lanes already consume
GET /__bili/plugin/manifestand register its tool surface (#1192); the opencode V2 lane was the outlier that didn't. This makes it do the same.How
On the first routed request — when
state.proxyBasebecomes known (native bootstrap / per-request routing discover it lazily, so setup-time isn't reliable) — fetch the manifest once and register whatever it advertises beyond the static set:TOOL_DELTA_RETRY_MS = 15000, pi/dsh parity);In practice the delta is
acp_retrievewhile CCR is armed andacp_rulewhile rules are on. The executor is factored intomakeToolExecutor(toolName)shared by both the static and delta registrations (behavior unchanged).Behavior change (disclosed)
acp_retrieve/acp_rule; CCR placeholders pointed at an unreachable tool.Config surface
None. No new env var, config field, or CLI flag. Uses the existing
ccr.*/ rule config the manifest already reflects.Tests
New regression test (
tests/opencode-v2.test.ts): a fake proxy serving a manifest that advertisesacp_retrieve→ asserts the base set is intact before traffic,acp_retrieveappears exactly once after the first routed request with the faithful production schema/options, and its executor forwards to the live dispatcher. Existing suite (incl. the inert/kill-switch/no-proxy paths that now exercise the degrade branch) stays green. Targeted run: 32/32; typecheck clean.Needs human review (per §7.4 — load-bearing tool-surface change)
One assumption worth confirming against real OpenCode 2.0.x: the fix issues a second
ctx.tool.transform(...)call (after the synchronous setup-time one) to add the delta. This relies on the transform editor accumulating / upserting by tool name across calls. Multi-plugin coexistence implies accumulation (a replace would stomp other plugins' tools), and a name-keyed catalog upserts rather than duplicating — so this should hold — but it is not pinned by any in-repo fixture. If real 2.0.x instead replaces the plugin's tool set on a second call, the delta registration would need to re-add the base set too (or move to a reload-based refresh). Please sanity-check on a live host before merge.Closes #2443