Skip to content

Lane decisions: single resolver for the four wire adapters — observed tool reachability fixes #3401 (#3417) - #3427

Merged
ranxianglei merged 4 commits into
masterfrom
2026-10-16_lane-decisions
Oct 17, 2026
Merged

ranxianglei merged 4 commits into
masterfrom
2026-10-16_lane-decisions

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Fixes #3401. Implements #3417 Steps 1–3 (v2 plan, comment 6217747677).

Why

The four wire adapters each carried their own copy of the lane gates, and the copies drifted twice (#3293 prompt/tool gate drift, #3401 lane name used as a reachability proxy — a dsh profile that DOES surface compress on the wire still had the model-side compress surface dropped). 22 raw pluginAgent === "..." comparisons across 8 files.

What

src/server/lane-decisions.ts — the three-layer terminal state from the plan:

  • ① HostProfile registry (dsh/pi/omp/opencode): the ONLY place lane names are compared. Properties: toolsHostScopedByDefault, wantsBillingBlock, compactsClientSide.
  • ② WireObservation: which bili tools THIS request declares (all three wire tool shapes), named-tool precision (biliToolsDeclaredOnWire(parsed, proto, "compress") — fix: DSH 压缩面抑制改为按工具实际可达性判定 (#3401) #3403 review follow-up: the nudge advertises compress specifically, a lane with only acp_status stays off).
  • ③ resolveLaneDecisions(): the one gate. compressReachable = !pluginMode (proxy injects structurally) || declaredTools.has("compress") (observation overrides the dsh default, #3401) || !profile.toolsHostScopedByDefault (host exposes by design, #3177). Frozen decision object; the four prepares consume compressSurfaceOn/Off.

Migrations in this PR:

  • the four dshCompressSurfaceOff copies → laneDecisions.compressSurfaceOff
  • the four dsh compact-rebase guards (#2432) → profile.compactsClientSide
  • structural guard test: prepares carry NO raw lane-name comparisons (regex-pinned; the typeof-cast feeding the resolver is input plumbing)

Behavior change (intended, exactly #3401)

lane shape before after
dsh, no bili tools on wire surface off (#3177) surface off (unchanged)
dsh, compress + host tools declared surface dropped (bug) surface kept
dsh, only acp_status + host tools surface dropped surface dropped (named-tool precision)
omp/pi/opencode surface on surface on (unchanged)
proxy mode surface on surface on (unchanged)
any lane, compress.injectTool: false nudge could still fire and dead-end on a tool never injected (gate drift, #3293 family — verified on master: the nudge gate reads injectNudge, not injectTool) nudge off everywhere (a nudge names compress; without the tool it is noise)

Tests

Deliberately NOT here

Rollout

None needed: the changed shape (dsh + tool-declaring) had the surface wrongly off — turning it on for that shape is the fix itself. Hosts that never declare tools see zero change, except sessions running with compress.injectTool: false: on master their nudge could still fire against a tool that was never injected; post-fix it stays off everywhere for them (row above; added during the #3331 range-audit review).

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-16_lane-decisions (5937551)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4082-pr.3427.3b6b29c

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

查重结论:不重复,但存在同根因双 PR。 检索 open+closed 后确认:#3403(最小门控修复:lane 名 → wire 可达性判定)与本 PR #3427(#3417 v2 计划 Steps 1–3 的单 resolver 重构,含 #3403 的修复语义)都指向 #3401。这不是简单重复——#3427 范围更大且吸收了 #3403 的行为变更;但按「一个 issue 最多一个 PR」纪律,若本 PR 合入,#3403 应作为被取代项关闭(反之亦然)。此点会写进最终审查结论,处置等你拍板。

开始按规范审本 PR:方向关(原 issue #3401/#3417)→ 整体回归清点 → 逐段 diff → 测试有效性 → CI 状态。本地只跑定向套件,全量交给远程 CI。稍后回结构化八问结论。

@ranxianglei ranxianglei added the ci:full Run the FULL CI matrix (all e2e lanes + 12-leg test matrix) on this PR label Oct 16, 2026
ranxianglei pushed a commit that referenced this pull request Oct 16, 2026
…nses (#3427 review)

All responses-wire reads migrated to laneDecisions.compressSurfaceOn, leaving the alias an unused local (noUnusedLocals not enabled). Removes the dead line and its now-stale comment clause.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审查结论:可合并(一处小修已直接修掉并推上分支,见下)。

查重:不重复;同根因双 PR 情况维持首条回复判定——#3403 范围被本 PR 严格吸收,本 PR 合入后 #3403 应关闭(等你拍板)。

方向关(原 issue):方向正确,打的是根因。#3417 的病因是「lane 名当可达性代理 + 同一门控四份拷贝各自漂移」,本 PR 落地了 v2 计划(#3417 comment 6217747677)的三层终态:① HostProfile 注册表(名字比较只活在这一个地方)② WireObservation(按请求实测 wire 上声明了哪些 bili 工具,点名 precision)③ resolveLaneDecisions 唯一决策点,四张 prepare 只消费不自算。观测推翻缺省正是 #3401 教训的落点,不是治标。

回归清点(逐项既有行为):

  1. dsh no-tools 形状(billion-context 0.1.197 在 DeepSeek Harness(DSH)0.2.0-rc.2 里反复抛出 Error: unknown tool "compress"。 工具注册落在了错误的作用域 #3177 原始保护场景):仍抑制——truth table 除修复行外与 master 逐行一致,plugin-nudge-injection pin 原样绿。
  2. pi/omp/opencode/proxy 模式:代数等价(非 dsh lane compressReachable 恒真 ⇒ surface = shouldInject,与 master 字节一致);session-continuity 9 / persona-fingerprint 8 全绿。
  3. responses developer 槽位 append 稳定性(billion-context 0.1.197 在 DeepSeek Harness(DSH)0.2.0-rc.2 里反复抛出 Error: unknown tool "compress"。 工具注册落在了错误的作用域 #3177 核心关切):host 工具表会话内稳定 ⇒ 标志不中途翻转;golden-storage-render 无 golden drift。
  4. 四处 [bug] DSH 桌面端 0.1.188:宿主原生压缩落地摧毁折叠基底 → 同一区间永久不可锚定、compress 连片失败并熔断(compaction-basic auto:false 仍无效) #2432 dsh compact-rebase guard:改读 profile.compactsClientSide,与原 ==="dsh" 语义等价(差异仅 trim,见行为变更③);issue2432-dsh-local-compaction 绿。
  5. 高危域点名:src/update.ts 自动更新路径——未触碰;dsh 安装/更新 lane——未触碰(handle.ts title-sidecar 等 B-class 站点按 v2 分类原地保留);lockfile/version——无变化(version-guard/lock-sync 绿);kernel/——零渗透(kernel-guard 绿);wire 字节——除 [bug] #3177 的 DSH compress-surface 抑制在「agent 能看到 bili 工具」的 DSH 环境下误伤:nudge 与 compress 系统提示被永久关闭 #3401 修复形状的槽位选择外不变(goldens 不含该形状,无需重钉)。

行为变更披露(旧 → 新):
① 【有意,即修复本身】dsh plugin 会话且请求 wire 声明 bili compress 工具:模型侧压缩面(nudge + 常驻提示)永久关闭 → 恢复。仅此一行翻转,其余行与 PR 表格一致。
② 【PR 表格未列,审查发现】anthropic wire + compress.injectTool=false:master 的 anthropic willInjectNudge 缺独立 shouldInject 合取项(其余三张 wire 都有),该形状下 master 允许注入 nudge——会催模型调一个没注入的工具,与 #3177 同类失效;本 PR 把 shouldInject 折进统一 alias 后 anthropic 对齐另外三张 wire → nudge 被抑制。这是「四份拷贝漂移」病灶的收敛效果,方向判为正确,按规则披露。波及面窄:仅显式设 injectTool=false 的用户。
③ 【nit】resolveHostProfile 对 pluginAgent 值做了 trim(原先精确比较):带空白填充的值(如 "dsh ")今后命中 dsh profile(原先匿名)。实际流量不产生这种值,可忽略。

代码级发现与处置:

  • 【已修】src/server/prepare-responses.ts:119 孤儿局部变量:所有读取迁到 compressSurfaceOn 后,const dshCompressSurfaceOff = laneDecisions.compressSurfaceOff; 成为死代码(tsconfig 未开 noUnusedLocals,tsc 不报),注释尾句 "alias kept for the remaining reads" 也与事实不符。已直接删除,commit 4536e12e3 已推 PR 分支(推前本地 tsc clean + matrix 17/17 验证过)。
  • 【披露不改】注册表里 wantsBillingBlock 目前零消费者——是 v2 计划声明的终态属性预置(B-class billing-block 迁移在计划后续步骤)。可接受,但建议要么消费掉、要么把该字段推迟到 follow-up PR;留你判断。

验证证据:

  • 本地:typecheck clean;定向 13 文件套件 121/121(含新 matrix 17/17);matrix 测试拷到 master 上跑恰好 5 红 = 4× dsh-compress-on-wire 行 + 结构守卫 ⇒ 「先钉红、后翻绿」的 characterization 主张成立。
  • 远端 CI:前 head ed12ed8 全部 30 项 check 绿(ubuntu/windows × node22/24 × 3 shards + static-gates/kernel-guard/lane-guard/unused-exports/docs-sync/config-surface-guard/e2e lanes);小修后新 head 4536e12 正在重跑。
  • 结构守卫(regex 钉死 prepare 内无裸 lane 名比较)通过;人工 grep 复核 src/ 剩余 lane 字面量全部是热路径外 B/C-class 站点,与 PR「Deliberately NOT here」清单吻合。

结构化八问:

  1. 是什么问题:agent 实际看得到、调得到 bili 工具的 DSH 环境里,模型侧压缩提醒和常驻 compress 提示被整条关掉;更深层是同一门控在四张 wire 适配器各存一份、两次漂移出 bug。
  2. 什么原因导致的:billion-context 0.1.197 在 DeepSeek Harness(DSH)0.2.0-rc.2 里反复抛出 Error: unknown tool "compress"。 工具注册落在了错误的作用域 #3177 用「lane 名 == dsh」当「工具不可达」的充分条件,但可达性随 DSH profile 变化,名字决定不了;四份拷贝是漂移载体。
  3. 影响范围与严重程度:DSH plugin 会话(报告者环境 97.3% 会话中招);特定条件下功能受损——模型侧压缩不可用,只剩 preflight 顶着(更贵、接近窗口才动手),非完全不可用。
  4. 怎么修复的:单一决策点——名字进 HostProfile 注册表(只供缺省)、每请求 wire 观测(是否声明 compress,点名精度)可推翻缺省、四张 prepare 只消费不自算、结构测试钉死 prepare 不再出现名字比较。
  5. 是否有回归问题:未发现。上面 5 项既有行为逐项过;高危模式(语义漂移/fail-fast 变吞错/阈值时序输出格式漂移)逐项排除——仅有的语义变化即披露的①②两条。
  6. 是否破坏缓存:没有。工具表会话内稳定 ⇒ 标志不翻转 ⇒ developer/system 槽位跨 turn append-stable;golden 无 drift,cache 相关 pin 全绿。
  7. 是否改了设计方向:没有转向——这正是 根本原因立项:按 lane 名的大面积特判拷贝在 4 张 wire 适配器里各自漂移(#3293/#3401 同形 bug 家族),需要抽象重构 #3417 拍板的三层终态实施(名字→身份只进①、环境→观测只进②、门控只出自③);kernel 零渗透不变。
  8. 是否引入新的配置:没有。无新 config/env/knob/默认值;version 未动。

收工判定:可合并。建议顺序:等新 head 4536e12 CI 绿 → 合并 → 关闭 #3403(被取代)。PR 留出的后续(willInjectNudge 归一、B-class 站点迁移)按 #3417 清单继续即可。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 跟进(修复 commit 4536e12e3 之后):30 项检查 29 绿,唯一红是 test (windows-latest, 24, 1),失败点与本 PR 改动无关,判定为 runner 负载型时序 flake:

已触发该 run 的 failed-job 重跑(run 38926853126)。若重跑转绿即结案;若同一断言再红,那就不是 flake,会按真回归排查。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

重跑结果:test (windows-latest, 24, 1) 转绿,flake 判定成立。现在 head 4536e12e3 上 30 项检查全绿(29 success + 1 条件性 skip),PR 处于可合并状态。

两点收尾说明:

  1. 分支落后 master,建议不 rebase:新落地的两个提交(修 flaky 测试:vscode 取消用例改为真实的『读着读着中断』形状 #3430 vscode-cancel 测试修复、定时全量失败自动开 issue,转绿自动关 #3428 CI red-signal 调度)只碰 .github/workflows/ci.yml 和 tests/vscode-copilot.test.ts,与本 PR 零文件交集。rebase 只会白白触发一轮全矩阵 CI,直接合并即可(merge/squash 均可)。
  2. 合并后请顺手关闭 fix: DSH 压缩面抑制改为按工具实际可达性判定 (#3401) #3403:它是同一根因([bug] #3177 的 DSH compress-surface 抑制在「agent 能看到 bili 工具」的 DSH 环境下误伤:nudge 与 compress 系统提示被永久关闭 #3401 的 dsh 可达性误判)的最小修复版,已被本 PR 完整吸收;留着会误导后续读者以为是两条并行修复线。

审核侧无遗留待办:回归清点、行为变更披露(① #3401 目标行 surface off→on;② anthropic wire + injectTool=false 时 nudge 与其余三 wire 对齐;③ resolveHostProfile trim 的无害 nit)、F1 死变量已修(4536e12e3)、F2 wantsBillingBlock 预置字段已披露——均在前一条八问回复里。等人工合并。

ranxianglei and others added 3 commits October 17, 2026 01:22
fixes #3401 (#3417)

- src/server/lane-decisions.ts: HostProfile registry (only name-comparison
  point) + WireObservation (per-request declared bili tools) +
  resolveLaneDecisions() consumed by all four prepares
- #3401 fix: dsh profile declaring compress on the wire keeps the compress
  surface (observation overrides the host-scope default)
- biliToolsDeclaredOnWire: named-tool precision (#3403 follow-up)
- dsh compact-rebase gate x4 -> profile.compactsClientSide
- tests/lane-decisions-matrix.test.ts: 4-wire x 4-row truth table (16 rows,
  #3401 row pinned green after the fix) + structural no-name-comparison guard
…nses (#3427 review)

All responses-wire reads migrated to laneDecisions.compressSurfaceOn, leaving the alias an unused local (noUnusedLocals not enabled). Removes the dead line and its now-stale comment clause.
…rix (#3427 review)

The disclosed anthropic-wire convergence (injectTool=false now suppresses
the nudge on all four wires) had no truth-table row. One row per wire,
expected {nudge:false, standingPrompt:false} — red on pre-fix master
[anthropic], green here.
@ranxianglei
ranxianglei merged commit 2164823 into master Oct 17, 2026
37 of 72 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.501-master.2164823 (rolling master tag).

npm install -g billion-context@0.0.501-master.2164823  # 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.

@github-actions github-actions Bot mentioned this pull request Oct 17, 2026
aolshevskiy pushed a commit to aolshevskiy/billion-context that referenced this pull request Oct 17, 2026
…i#3600)

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 ranxianglei#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 ranxianglei#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the FULL CI matrix (all e2e lanes + 12-leg test matrix) on this PR 发版

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] #3177 的 DSH compress-surface 抑制在「agent 能看到 bili 工具」的 DSH 环境下误伤:nudge 与 compress 系统提示被永久关闭

1 participant