Skip to content

fix: dsh PTC run_code omnibus reads as compress-reachable — 0.1.198 nudge suppression regression (#3600) - #3603

Merged
ranxianglei merged 1 commit into
masterfrom
fix/ptc-run-code-reachability
Oct 17, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
fix/ptc-run-code-reachability

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

ai: zhipuai-lb/glm-5.3

Fixes #3600

什么坏了(一句话)

0.1.198 起,dsh 桌面版开 PTC(run_code)模式的会话压缩面被整体关闭:nudge 全部压制(issue 实测 89 次 ARMED-SUPPRESSED),窗口一路涨到 100%,output 被 clamp(128k→82k),会话实质报废——而且完全静默。同机同天的 standard 模式会话一切正常。

根因(#3427 引入,首次发布就在 v0.1.198)

src/server/lane-decisions.ts
const compressReachable = !input.pluginMode
    || declaredTools.has("compress")
    || !profile.toolsHostScopedByDefault;   // dsh = true → 只有第二行说了算

修法(最小、方向乐观、精度保留)

顶层出现 run_code 拢子即视为可达:

const compressReachable = !input.pluginMode
    || declaredTools.has("compress")
    || declaredTools.has("run_code")        // #3600: PTC omnibus
    || !profile.toolsHostScopedByDefault;

理由:omnibus 把所有工具吞进绑定,顶层缺席不构成「不可达」的正证据。两条既有语义原样保留:

测试

  • tests/lane-decisions-matrix.test.ts 新增 2 行 × 4 wire = 8 断言:
    • dsh run_code omnibus keeps the surface (#3600 PTC shape) → nudge+standingPrompt 开;
    • dsh single non-omnibus tool still drops the surface (precision retained) → 仍关。
  • 全套 30/30 绿;lane-decisions-b-class 绿;tsc --noEmit 干净。

备注(不阻塞本 PR)

PTC presets collapse every tool into a single run_code omnibus (SDK
bindings nested inside), so the top-level tools array carries no
compress entry. The #3427 reachability gate read that shape as
unreachable and suppressed the compress surface on every dsh PTC
session in released 0.1.198 — nudge suppressed to the 100% window
(89x ARMED-SUPPRESSED), output clamped, session effectively dead,
while standard-mode sessions kept compressing.

An omnibus declaration now reads as reachable: top-level absence is
not evidence of unreachability when the omnibus swallows everything.
The #3177 true negative keeps its suppression (a bare single tool
that is neither compress nor the omnibus still drops the surface).

Truth-table rows added: run_code omnibus keeps the surface on all
four wires; single non-omnibus tool still drops it.
@ranxianglei
ranxianglei merged commit 2244a07 into master Oct 17, 2026
35 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: fix/ptc-run-code-reachability (819dc3d)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4252-pr.3603.ca16fa9

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-pr3603.tgz
npm install -g package

Install instructions are refreshed on each push.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.537-master.2244a07 (rolling master tag).

npm install -g billion-context@0.0.537-master.2244a07  # 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.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复。 按失败签名("run_code omnibus" / "ARMED-SUPPRESSED" / "compressSurfaceOn" / PTC+可达性)检索 open+closed issue 与近期 PR,无同症状+同机制的在途或已关条目。相关条目各居其位、机制不同:#3600 是原始缺陷单;#3427 引入可达性判据(回归源头);#3401/#3177 是同一条判据的第一个盲区(lane 名静态标签 / named-tool 精度);#3298 记录了 PTC 折叠工具的已知事实;#3252 建立了 code-mode 形状的 ptcNoteMode() 检测惯例。本 PR 正是补上它们留下的缺口,无平行工作。

状态:本 PR 已合并(merge commit 2244a07c3,2026-10-17T16:25Z,在 master 上)。按 [PR] 流程不重做,我独立核对了代码、测试、CI 与回归面。结论:合并质量通过、无回归,另发现一处小瑕疵(triage 承诺的常量复用未落地)——正在切 follow-up 小修 PR,完成后单独回报。

独立审核记录(自己重读 diff 与调用链,未照抄 issue 结论):

  • ① 方向:正确。修的是可达性判据本身(补上「经 run_code SDK 绑定可达但未在顶层声明」的第三种形态),不是在某层过滤症状;与 [bug] 0.1.198 PTC(run_code)会话压缩面被永久压制:顶层 tools 只有 run_code ⇒ declaredTools.has("compress") 恒 false ⇒ nudge 从不注入 #3600 的根因链一致。
  • ③ 代码机制成立:核实 observeDeclaredTools()(src/server/lane-decisions.ts:52)对三种 wire 形状收集全部顶层工具名,且 biliToolsDeclaredOnWire(..., named)(src/session-self-heal.ts:246)带 named 参数时做精确名字匹配、不做 bili 白名单过滤 ⇒ run_code 确实会进入 declaredTools,新增析取项真实生效(不是写了个永远为 false 的分支)。
  • ② 回归审计(逐项清点既有行为):proxy 模式不变(!pluginMode 短路);pi/omp/opencode 等插件车道不变(其 toolsHostScopedByDefault=false,末位析取项本就恒真——src/host-profiles.ts:71-80 确认 dsh 是唯一 true);dsh standard 模式不变(顶层含 compress,前后行为一致);injectTool=false 用户不变(config 总开关仍优先)。唯一行为面 = dsh PTC 会话从「压缩面恒关」变「开」——这正是修复目的,CHANGELOG 已披露。残余风险(PR 自述):某宿主若声明顶层 run_code 却实际够不到 compress,会注入 nudge → 最坏一次失败的 compress 调用,由 self-heal/breaker 有界兜底;EMERGENCY 反向护栏属 Three issues found during real-model stress testing: WS passthrough can't connect — HTTP upstream is guaranteed to die; | 真模型压测发现的三个问题:WS 直通连不上 HTTP 上游必死、超限时死锁+紧急提示风暴、compress 激活本身太重 #3461 家族独立话题。缓存:flag 按请求从 parsed.tools 重算的逻辑未动,dsh PTC 工具表会话内稳定 ⇒ 前缀缓存稳定,与既有同类行为一致。
  • ④ 测试有效:两条新矩阵行走真 startServer + HTTP 全管线(非单测桩),四 wire × 正反两向钉死;STANDING_MARKER("acp_status")区分完整 prompt 与 tags-only 回退,该 bug 回归时抓得住。
  • ⑤ diff 整洁:3 文件 = 源码 1 行(+注释) / 测试 2 行 / CHANGELOG 条目,无无关改动。
  • CI:merge commit 的静态门禁全绿(gate / config-surface / docs-sync / lock-sync / unused-exports / docs-coverage / test-import-graph / build-artifact / real-image billing e2e);test shards 被后续 master push 取代而 cancelled(正常 supersede),master HEAD 的 CI 在我确认时 queued/进行中,最终裁决以远程 CI 为准。另见 .github/workflows/ci-gate-plugins.yml 在合并后连续几个 commit 红——查证:该 workflow 是手动专用门禁(仅 workflow_dispatch),被 push 事件误触发、零 job、瞬时 failure,不是真失败,与本 PR 范围无关。

发版状态提醒(需你拍板):最新 tag 仍是 v0.1.198(= 坏版本),已用 git 确认本修复不在该 tag 内——升到 0.1.198 的用户在下个版本前依然坏(临时规避:切回 standard 模式或回退 0.1.197)。按流程发版需 owner 批准:建议切 v0.1.199 patch release 带上此修复,等你签核。

结构化八问:

  1. 是什么问题:0.1.198 起 dsh 桌面版 PTC(run_code) 会话压缩面被整体关闭——nudge 从不注入,窗口涨到 100% 后 output 被 clamp,会话实质报废,全程静默。
  2. 什么原因导致的:Lane decisions: single resolver for the four wire adapters — observed tool reachability fixes #3401 (#3417) #3427 引入的可达性判据只建模了「wire 可见」与「宿主按设计暴露」两种形态,漏了 PTC「所有工具折叠进 run_code 绑定」的第三种形态;dsh 的 toolsHostScopedByDefault=true 使判据退化为「顶层是否有字面 compress」,PTC 下恒 false。
  3. 影响范围与严重程度:仅 dsh PTC 形态会话(standard 模式与其他宿主不受影响);严重度=功能完全不可用(压缩失效)+静默,会话可用直到窗口 100%。
  4. 怎么修复的:可达性判据加 run_code 析取项——omnibus 折叠下顶层缺席不构成「不可达」的正证据;billion-context 0.1.197 在 DeepSeek Harness(DSH)0.2.0-rc.2 里反复抛出 Error: unknown tool "compress"。 工具注册落在了错误的作用域 #3177 真阴性与 [bug] #3177 的 DSH compress-surface 抑制在「agent 能看到 bili 工具」的 DSH 环境下误伤:nudge 与 compress 系统提示被永久关闭 #3401 正例两条既有语义原样保留。
  5. 是否有回归问题:无。proxy 模式 / 非 dsh 插件车道 / dsh standard / injectTool 开关逐项审过均不变;残余风险(声明 run_code 但实际够不到 compress 的宿主会收到可能失败的 nudge)由 self-heal/breaker 有界兜底,已在 PR 披露。
  6. 是否破坏缓存:不破坏。flag 重算逻辑未动,dsh PTC 工具表会话内稳定,前缀缓存稳定。
  7. 是否改了设计方向:没有。仍走「wire 观察」代理信号路线;结构级修法(宿主 manifest 注册状态为真源)继续在 根本原因立项:按 lane 名的大面积特判拷贝在 4 张 wire 适配器里各自漂移(#3293/#3401 同形 bug 家族),需要抽象重构 #3417/lane 统一决策点收尾:还剩四处按客户端名字自算的旁路要搬进来(#3417 待做) #3482 Step3+ 路线上。
  8. 是否引入了新的配置:没有。

判定:PR 合并质量通过(方向、机制、测试、diff 四项全过);小瑕疵走 follow-up 小修 PR(进行中);发版待你拍板(建议 v0.1.199)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

follow-up 小修已开:#3609 — #3609

兑现上一条审核里点出的瑕疵(常量复用未落地):

当前状态小结:

  1. 主修复(fix: dsh PTC run_code omnibus reads as compress-reachable — 0.1.198 nudge suppression regression (#3600) #3603)已合并、独立审核通过、无回归——见上条八问回复;
  2. follow-up 小修 refactor: lane-decisions 复用共享的 RUN_CODE_TOOL_NAME(follow-up 小修,#3603) #3609 在途等 CI + 人工合并;
  3. 发版待你拍板:最新 tag 仍是坏版本 v0.1.198,建议切 v0.1.199 patch release 带上此修复(流程上等你签核)。

ranxianglei added a commit that referenced this pull request Oct 17, 2026
…n-code-const

refactor: lane-decisions 复用共享的 RUN_CODE_TOOL_NAME(follow-up 小修,#3603)
aolshevskiy pushed a commit to aolshevskiy/billion-context that referenced this pull request Oct 17, 2026
ranxianglei pushed a commit that referenced this pull request Oct 20, 2026
…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.
ranxianglei pushed a commit that referenced this pull request Oct 20, 2026
…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.
yanhuojiyusheng pushed a commit to yanhuojiyusheng/billion-context that referenced this pull request Oct 20, 2026
…le (ranxianglei#3884)

ranxianglei#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 (ranxianglei#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 (ranxianglei#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.
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