Repository navigation
[PR] fix: read Responses additional_tools preamble in tool reachability observation - #5528
Conversation
…servation Codex-shaped hosts (DSH via pi-ai) declare the model-visible bili tools in input[].type==="additional_tools" preamble items and send no top-level tools array. Both reachability consumers (observeDeclaredTools in lane-decisions + biliToolsDeclaredOnWire feeding the session-self-heal zombie signal) read only the top level, so such requests were read as "no tools at all": compress surface off and the nudge permanently suppressed even after the growth threshold was crossed (issue log: pendingT1=62364/ 50000 ARMED-SUPPRESSED surface=off(no-tools)). declaredToolEntries (session-self-heal.ts) is now the single collector for every wire declaration location: top-level tools on all protocols plus the Responses additional_tools preamble; both consumers share it (#3417 drift-prevention discipline). Per-entry extraction and named-tool precision are byte-identical; an acp_status-only preamble keeps the surface off. Log string formats unchanged.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7858-pr.5528.204f537This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5528.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重结论:不重复(独立缺陷,无既有修复)。检索 open+closed 的 issue 与 PR:把 Responses
标签:bug / dsh / scope-wiring / p2(沿用源 issue #5527 的分类)。说明:[PR] 线程的镜像 labels API 在本环境未实现(endpoint not implemented)、 PR 审核结论(结构化八问)
测试有效性:新增 8 个单元测试(全走真实入口 CI:head sha 上 50 项 check,已完成 lane 全绿(static-gates、mysql-contract、ubuntu/windows × node22/24 各 test shard),e2e lane 按 env 门控正常 skip,唯一 diff 整洁度:4 文件 +195/-21,每行都与目的相关,无无关 churn/锁文件/生成物。命名达意、null-safe、注释讲 why(#5527/#3417/#3600/#3884 溯源)、无 合入判定:可合auto-merge gate §7.4 八条全过(单一观测层修复 / 回归测试复现且转绿 / head 上绿 / 不动 config·wire·kernel·持久化 /
|
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1005-master.f294c54 # this exact build
npm install -g billion-context@master # always the newest merged build
|
…king replay + ranxianglei#5528 additional_tools reachability Eight files; two overlap this lane and both auto-merged: - src/loop/core.ts: master's ranxianglei#5495 replay/exposure hunks sit at :178 and :1317-1331, this lane's draft-dump gate at :1181 and the DEGENERATE_RETRY_NUDGE import at :49. Verified after the merge that both sides are present. - src/server/relay.ts: master's hunk is at :1576, this lane's non-SSE pipePluginJson egress at :1976. Both present. Post-merge: kernel build, tsc, lane suites and the four static gates re-run.
…conflict resolution) Union-of-intent on src/session-id.ts: master already carries the functional change via #5825 (x-conversation-id in conversationHeaderSource at the same low-trust position, plus agent-session-id), so the conflicted hunk takes master's version verbatim. Net PR delta vs master reduces to: - tests/proxy-session-id.test.ts: priority-order regression assertions (complements #5825's identity-harvest coverage; adds claude/x-session-id vs x-conversation-id cells) - README.md / README.zh-CN.md: list x-conversation-id in the session-identity header walks (the enumeration was left stale by #5825)
Closes #5527
Summary
DSH's pi-ai Codex Responses path declares the model-visible bili tools (incl.
compress) insideinput[]itemstype: "additional_tools"(role developer), with NO top-leveltoolsarray. Both reachability consumers read only the top level:observeDeclaredTools(src/server/lane-decisions.ts) ->declaredToolsempty -> dsh profile (toolsHostScopedByDefault) ->compressReachable=false->compressSurfaceOn=false-> nudge AND standing compression prompt permanently suppressed (issue log:nudge ARMED-SUPPRESSED T1 pendingT1=62364/50000 surface=off(no-tools));biliToolsDeclaredOnWire(src/session-self-heal.ts) — the 会话卡死自愈机制:卡死模式检测与代理侧主动补救 #2155 zombie-lane signal carried the same blind spot.The kernel already treats
additional_toolsas an opaque preamble item (kernel/src/wire/responses.ts OPAQUE_ITEM_TYPES); wire handling was fine, only the reachability observation was blind.Fix
One collector, two consumers (#3417 drift-prevention discipline):
declaredToolEntries(parsed, protocol)in src/session-self-heal.ts gathers entries from top-leveltools(all protocols) plus, forresponses, eachinput[].type==="additional_tools"preamble item's nestedtools.observeDeclaredToolsandbiliToolsDeclaredOnWireboth iterate it. Per-entry extraction (flat name / function.name / functionDeclarations) and named-tool precision are byte-identical; non-responses protocols do not scaninput[](the location is wire-specific).Behavior change (old -> new)
dsh lanes declaring bili tools ONLY via the Responses additional_tools preamble: compress surface OFF -> ON when
compressis actually declared there. Previously the nudge stayed ARMED-SUPPRESSED forever after crossing the 50K growth threshold while the model could still call compress (the reported "compress cannot be triggered").acp_statuskeeps the surface OFF — named-tool precision, not unconditional on.surface=off(no-tools)/surface=off(top-level=[...])).Tests
tests/issue5527-additional-tools-reachability.test.ts(8 unit tests): issue shape positive; acp_status-only negative; omnibus run_code/code_run via preamble ([bug] 0.1.198 PTC(run_code)会话压缩面被永久压制:顶层 tools 只有 run_code ⇒ declaredTools.has("compress") 恒 false ⇒ nudge 从不注入 #3600/[BUG] 0.1.202 DSH 0.2.x code-mode channel: omnibus is actually namedcode_run,RUN_CODE_TOOL_NAMEhardcoded to `run_ | [BUG] 0.1.202 DSH 0.2.x code-mode 通道:omnibus 实际名为 code_run,RUN_CODE_TOOL_NAME 硬编码 run_code ⇒ 压缩面永久压制(#3603 修复复发) #3884 family); hostile single regular tool negative; non-responses protocol gate; top-level control; mixed-location union; self-heal consumer named/legacy forms; collector shapes.tests/lane-decisions-matrix.test.ts: 3 new responses-only rows through the real chain (the 5 reporter-requested shapes split across matrix + unit file); tightened the responses devItem probe to the canonical view (prepare-responses.ts) so fixture preamble items cannot false-match.config surface: none. kernel: untouched. version: untouched.