Skip to content

[PR] fix: dsh 0.2.x code-mode omnibus code_run reads as compress-reachable (#3884) - #3885

Merged
ranxianglei merged 5 commits into
masterfrom
2026-10-20_codemode-omnibus-code-run
Oct 20, 2026
Merged

ranxianglei merged 5 commits into
masterfrom
2026-10-20_codemode-omnibus-code-run

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #3884

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

什么坏了(一句话)

所有 DSH 0.2.x Code Mode / PTC 会话的压缩面被永久且静默关闭:nudge 恒 ARMED-SUPPRESSED(issue 实测 12 次,usage 仅 42%、pendingT1 达门槛 10 倍、INJECT 0 次),上下文一路涨到 63% 靠人工兜底。

根因

#3603 的可达性门只认单个字面量 run_code(RUN_CODE_TOOL_NAME)。DSH 0.2.x 把 Code Mode 移入 dsh-codemode 插件后,其 transport 名为 code_run(保留名 run_code 归 dsh-tools,插件不能注册)——门失配,可达性合取式全假 ⇒ 面恒关。与 #3600/#3603 同一条判定链、同一日志形状,只是常量对不上。

顺带发现同机制家族的第二处检测点:proxy 车道的 ptcNoteMode() 同样只匹配 run_code——code_run 客户端的注入工具拿不到 exempt 注记(「bili 工具请直接调用」),在 harness「只许调 omnibus」规则下模型可能拒调 compress,同类静默失效。一并修入本 PR(同一失败域,不拆片)。

修法

行为变更披露(旧 → 新)

面 旧 新
dsh 插件车道,顶层仅声明 code_run 压缩面恒关(nudge/standing prompt 全压制) 开(与 run_code 形态一致)
proxy 车道,客户端工具含 code_run 注入的 ACP 工具无 exempt 注记 带 PTC_EXEMPT_NOTE(与 run_code 形态一致)
其余一切形态(裸非 omnibus 工具、无工具、其他车道/模式) 不变 不变(既有负例行钉死)

两处变更即修复目的本身:从「错误压制」恢复到与其他 omnibus 形态一致的正常状态,不触碰任何其他会话形态。

测试(双向断言,#3617 纪律)

  • tests/lane-decisions-matrix.test.ts:新增 dsh code_run omnibus keeps the surface (#3884) → 开面(×4 wire)+ EMERGENCY 对偶行;真阴性精度行(get_weather / acp_status → 关面)不变,与新行构成正负对;
  • tests/ptc-runcode-tools.test.ts:新增 code_run → exempt 注记 4 行(四 wire 各一);bash-only 行钉负向;
  • 本地定向绿:typecheck 干净;matrix 66/66;ptc-runcode-tools 16/16;e2e-ptc-runcode-shape 8/8。全量裁决以远程 CI 为准。

…le (#3884)

#3603's single-literal gate (RUN_CODE_TOOL_NAME = "run_code") went stale
when DSH 0.2.x moved Code Mode into the dsh-codemode plugin, whose
transport is named `code_run` (the reserved name `run_code` belongs to
dsh-tools, so the plugin registers its own). On every DSH 0.2.x code-mode
session the reachability conjunct failed and the compress surface stayed
off forever: nudge ARMED-SUPPRESSED at 42% usage with pendingT1 10x over
threshold, zero INJECT, fully silent (#3884).

- collect the known omnibus shapes in CODE_MODE_OMNIBUS_TOOL_NAMES
  (run_code / code_run), provenance-commented per shape; both detection
  sites match the set - lane-decisions reachability (the reported miss)
  and ptcNoteMode (proxy-lane exempt note, same-mechanism second site)
- matrix: dsh code_run row -> surface on + EMERGENCY twin; existing
  precision rows (get_weather / acp_status) stay the negative direction
- ptc-runcode-tools: code_run -> exempt note on all four wires; bash-only
  rows pin the negative direction (#3617 bidirectional discipline)

Targeted green: typecheck clean; lane-decisions-matrix 66/66;
ptc-runcode-tools 16/16; e2e-ptc-runcode-shape 8/8. Full suite = CI.
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-20_codemode-omnibus-code-run (2bb8a67)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4649-pr.3885.651d0ab

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-pr3885.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)

查重:不重复。全仓检索 code_run 仅命中本 PR(#3885)与原 bug 单(#3884,SeaWangl 报),无并列修复 PR。#3884/#3885 是 #3600/#3603(run_code 形态可达性门)在 DSH 0.2.x 新宿主形态上的复发,不是重复项。

标签:bug · dsh · scope/wiring · p1 —— 缺陷类;DSH 专用;改动落在「客户端工具表 → 压缩面可达性判定」,属协议接线层;DSH 0.2.x code-mode 会话压缩面被永久静默关闭 = 核心承诺失灵 + 上下文只增不减,判 p1。

独立复核(未照抄 issue 结论,按 tag 读码):dsh profile toolsHostScopedByDefault=true,src/server/lane-decisions.ts 可达性四合取项在 DSH 0.2.x(插件模式、顶层无 compress、声明的是 code_run 而非 run_code、host-scoped)下全假 ⇒ 面恒关,根因成立。本地定向验证:typecheck 干净;tests/lane-decisions-matrix.test.ts 66/66 + tests/ptc-runcode-tools.test.ts 16/16 = 82/82 绿(含新增 code_run 正例行 ×4 wire + EMERGENCY 对偶行,以及既有真阴性负例行)。全量裁决以远程 CI 为准。

八问

  1. 是什么问题:所有 DSH 0.2.x Code Mode / PTC 会话的压缩面被永久且静默关闭——nudge 恒 ARMED-SUPPRESSED(issue 实测 usage 仅 42%、pendingT1 达门槛 10 倍、INJECT 0 次),上下文一路涨到 63% 靠人工兜底。
  2. 什么原因导致的:fix: dsh PTC run_code omnibus reads as compress-reachable — 0.1.198 nudge suppression regression (#3600) #3603 的可达性门只认单个字面量 RUN_CODE_TOOL_NAME="run_code";DSH 0.2.x 把 Code Mode 移入 dsh-codemode 插件后 transport 改名为 code_run(保留名 run_code 归 dsh-tools,插件不能注册),门失配 ⇒ 可达性合取式全假 ⇒ 面恒关。同一条判定链、同一日志形状,只是常量对不上([bug] 0.1.198 PTC(run_code)会话压缩面被永久压制:顶层 tools 只有 run_code ⇒ declaredTools.has("compress") 恒 false ⇒ nudge 从不注入 #3600 的复发)。
  3. 影响范围与严重程度:限 DSH 0.2.x code-mode/PTC 会话(顶层仅声明 code_run);其余客户端形态不受影响。严重度 p1——压缩完全不工作(核心承诺失灵)+ 上下文无界增长,且全程静默无告警。
  4. 怎么修复的:把「已知 omnibus 形态」收敛为集合 CODE_MODE_OMNIBUS_TOOL_NAMES(={run_code, code_run},逐条注释出处),两处检测点共用成员判定——lane-decisions 可达性(主缺陷)+ proxy 车道 ptcNoteMode 的 exempt 注记(同族第二处:此前 code_run 客户端拿不到「直接调用」豁免注记,模型可能在「只许调 omnibus」规则下拒调 compress)。不采纳「描述语义模糊匹配」:会削弱 billion-context 0.1.197 在 DeepSeek Harness(DSH)0.2.0-rc.2 里反复抛出 Error: unknown tool "compress"。 工具注册落在了错误的作用域 #3177 真阴性精度、与 never-fuzzy-similarity 路线冲突。
  5. 是否有回归问题:逐项过既有行为——非 dsh 车道(pi/omp/opencode)toolsHostScopedByDefault=false 本就恒可达,加集合项不影响;dsh 裸单一非 omnibus 工具(get_weather / acp_status / bash)仍关面,由既有负例行钉死;dsh 声明 run_code 的行为不变。两处 delta 即修复目的本身,无意外回归;高危模式(fail-fast 变吞错、阈值/时序/输出格式漂移)均不涉及。
  6. 是否破坏缓存:不涉及——不改任何缓存键 / 前缀 / 重试 / 去重逻辑,只改「是否注入压缩面」与 ACP 工具注记文本。
  7. 是否改了设计方向:否——仍在既定「wire 形态作为可达性代理信号」框架内补一个已知形态;结构级真源(宿主 manifest 注册状态)明确留给 根本原因立项:按 lane 名的大面积特判拷贝在 4 张 wire 适配器里各自漂移(#3293/#3401 同形 bug 家族),需要抽象重构 #3417/lane 统一决策点收尾:还剩四处按客户端名字自算的旁路要搬进来(#3417 待做) #3482 Step3+,本 PR 不越界。
  8. 是否引入了新的配置:否——纯代码常量,无新 env / config / 默认值。

diff 整洁度:5 文件、约 83 行,全部与本修复直接相关,无跑题文件 / 空行重排 / lockfile 抖动。测试双向断言合规(#3617):正负成对,新增行有牙(code_run 行在 master 上会失败,修后转绿)。

CI 状态:GitHub 出站此刻持续 connection-reset(npm registry 可达、github.com 不可达),暂读不到远程 CI 结果;按瞬时网络故障处理,不作终局判断。本地定向证据(typecheck 干净 + 82/82)已覆盖本 PR 触碰的全部面。

判定:代码可合。因涉及 ACP 工具描述文本这一 wire-adjacent 变更(且跨 2 模块),走 human merge、不进 auto-merge;待远程 CI 转绿即合。网络恢复后我会再核一次 CI 状态并回帖确认。

@ranxianglei ranxianglei added bug Something isn't working dsh p1 scope/wiring labels Oct 19, 2026
awork added 3 commits October 20, 2026 08:56
…ss surface off (#3884)

Observability hardening for the allowlist fragility class: when an armed nudge stays ARMED-SUPPRESSED because the lane surface is off for reachability (not user config), the diag line now carries surface=off(no-tools) or surface=off(top-level=[names]) — the next host omnibus rename shows up in bili.log next to the suppression label instead of requiring user archaeology (#3600 and #3884 were both diagnosed from user-reported dumps). No behavior change beyond log text.
…s gate

RUN_CODE_TOOL_NAME (src/compress-tool.ts) and maskUrlForPublish
(src/log-mask.ts) are each used only within their own module and imported
nowhere; the unused-exports gate classifies both INTERNAL_ONLY. Drop the
redundant leading `export` so the gate passes; both stay module-local and
behavior is unchanged. Clears the unused-exports check on #3885.
CONFIGURATION.md/.zh-CN.md carried two stale duplicate rows left behind by
#3818 (storage.unified shadow->full flip kept the old shadow row) and #3788
(sqliteAutoDownload cooldown text added a new row but kept the old one). The
config-docs generator (source of truth: website/config-reference/*.yaml) emits
only the current rows, so docs-sync failed on the merge. Regenerated from
seeds; removes 2 stale rows per language file. No config-surface or behavior
change. Pre-existing on master, surfaced via #3885's merge.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 两处红已在 PR 分支直接修掉并 push(14eec04b2..1e629d887,fast-forward、未 force),本地用与 CI 完全相同的门禁命令复验,两条均绿。

改动(2 个 commit,均几行级小修):

  • fix: 去掉两个「只在本模块内使用、无处 import」的多余 export —— src/compress-tool.ts 的 RUN_CODE_TOOL_NAME、src/log-mask.ts 的 maskUrlForPublish。两者仍在本文件内被引用(分别用于构建 omnibus 名集合 / maskUrlsForPublish),行为不变。
  • docs: 从 yaml seed 重新生成配置参考文档,删掉 CONFIGURATION.md / .zh-CN.md 里各 2 行陈旧重复行(storage.unified 的旧 shadow 默认行、storage.sqliteAutoDownload 缺 SQLite unified storage degraded to legacy-only (bili v0.1.201, node v20.19.5, win32-x64) #3788 冷却文案的旧行)。

结构化结论:

  1. 是什么问题:PR 两个 CI 门禁红——unused-exports 报了 2 个「导出了但没有任何地方 import」的符号;docs-sync 发现配置文档里有和 seed 对不上的重复行。
  2. 什么原因导致的:这两处都不是本 PR([BUG] 0.1.202 DSH 0.2.x code-mode channel: omnibus is actually named code_run, RUN_CODE_TOOL_NAME hardcoded to `run_ | [BUG] 0.1.202 DSH 0.2.x code-mode 通道:omnibus 实际名为 code_run,RUN_CODE_TOOL_NAME 硬编码 run_code ⇒ 压缩面永久压制(#3603 修复复发) #3884)代码引入的回归,而是合并基线(master)里本来就存在的状态——两个符号早已是「仅模块内使用却带 export」,文档里 Storage wrap-up: 6 fixes + switch default mode to full (single PR) | 存储收尾六修 + 缺省模式翻 full(一个 PR 统一处理) #3818(shadow→full 翻转)与 SQLite unified storage degraded to legacy-only (bili v0.1.201, node v20.19.5, win32-x64) #3788 各留了一行旧副本没清。本 PR rebase 到当前 master 后,merge 触发了这两个检查才把它暴露出来。
  3. 影响范围与严重程度:纯 CI 卡口层面,不影响任何运行时行为、wire 格式或用户可见功能;严重度 = 仅内部实现/构建门禁,不阻断用户使用。
  4. 怎么修复的:unused-exports 按脚本给出的 INTERNAL_ONLY 处置——去掉多余 export(不删声明,因本文件仍在用);docs-sync 直接跑官方生成器从 seed 重新生成,让提交态 == 生成器输出(幂等:重跑无新增 diff)。
  5. 是否有回归问题:无。去掉 export 只收窄可见性,全仓各文件类型 grep 确认没有任何地方 import 这两个符号,in-file 引用不受影响;文档改动只删陈旧重复行,保留的是当前正确的行(full 默认 + 冷却文案),配置面与行为零变化。已核既有行为:omnibus 工具名集合 CODE_MODE_OMNIBUS_TOOL_NAMES 仍正常导出并被 lane-decisions / ptcNoteMode 使用,maskUrlsForPublish 公共入口不变。
  6. 是否破坏缓存:不涉及(纯源码可见性 + 文档)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:两条红线均为可确定性修复的小问题,已就地修好并推送,等远程 CI 在 pushed head 上复跑确认即转绿。顺带说明:这两处的根因都在 master 侧(合入后 master 一并被修复);本地未跑全量 typecheck/test(按仓库纪律交给远程 CI 把关),已用精确门禁命令 + AST 解析通过验证改动本身安全。

@ranxianglei
ranxianglei merged commit f9e0d27 into master Oct 20, 2026
24 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.647-master.f9e0d27 (rolling master tag).

npm install -g billion-context@0.0.647-master.f9e0d27  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dsh p1 scope/wiring

Projects

None yet

1 participant