Repository navigation
fix: route dsh title-gen requests through the side lane on dsh 0.2.1-alpha.2 (#2503) - #2554
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2738-pr.2554.c3e95cdThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2554.tgz
npm install -g packageInstall instructions are refreshed on each push. |
#2554 review: the new pure-predicate test pins isDshTitleRequest but nothing ungated pins the handle() wiring (both decision-point disjuncts). The gated e2e runs the rc.2 dsh pin where the legacy budget heuristic already catches titles, so it cannot catch a wiring regression. This drives the wiring hermetically on the OpenAI wire (dsh's actual shape) with the worst-case title-first ordering (#2156/#2160 anchor-claim hazard): verbatim forwarding incl. the alpha.2 4096 budget, zero kernel-state impact, no |sub:<fp> ghost minted at any point. Red-proofed against pre-fix handle.ts (fails on the verbatim assertion: the full pipeline appends the compression-tool system prompt).
#2554 review: lane-guard (#2170) only watched src/server/side-request.ts + lane-symbol lines in src/server.ts, but #1440's extraction moved the lane region into src/server/handle.ts — deleting a lane disjunct there would trip no gate. Extend the symbol watch to handle.ts (incl. the two new #2503 symbols). Behavior change: the guard is now stricter — any +/- line mentioning a lane symbol in handle.ts requires a paired side-lane suite update (same exposure server.ts already had).
[bot] 🏷 PR #2554 review 完成(含两处 review 补强 commit,已推到 PR 分支) 查重:open+closed issue/PR 全搜过,无重复项(与 #2500 server-tool utility、#2156/#2160 锚点链是同一机制族的不同实例,本 PR 引用正确,不另立项)。 审核过程(不是只看 diff):在 PR head 本地复现了全部关键路径——typecheck/unused-exports 干净、9 个 side-lane 相关套件全绿、对 结构化八问1. 是什么问题:dsh 0.2.1-alpha.2 把 title sidecar 的预算从 64 提到 4096,bili 不再认得它是 side request——标题生成请求被当成主轮次处理,在 #1916 persona fingerprint 下 fork 出持久化的 2. 什么原因导致的:分层说清。表面现象 = ghost session + 标题垃圾进 kernel 状态。机制层根因 = side-lane 判定对 dsh title 依赖的是 wire 启发式( 3. 影响范围与严重程度:仅 dsh ≥0.2.1-alpha.2 用户(rc2 及更早不受影响);触发条件 = 每次 dsh 会话启动时的 title 生成。严重度:特定条件下有问题——每会话一个持久化 ghost session、title 轮污染 kernel 状态与 stats、浪费上下文;最坏排序(title 先于首个主轮到,#2156/#2160 类)下 anchor claim 可能把整个主会话 fork 到 ghost 上、ACP 管理调用全部路由进空 session。主会话数据本身不损坏。 4. 怎么修复的:纯谓词 5. 是否有回归问题:逐项审过的既有行为——① legacy ≤200 启发式未动,其他客户端 side request 行为不变;② no-tools veto 保证未来任何带 tools 的主轮次不可能经此路径被降级(防过度分流);③ 两个决策点读同一个 header( 6. 是否破坏缓存:否。sidecar 不触碰主会话消息流/system 稳定性(raw-key session 的 inputTokens/contextTokens 前后不变,已断言钉住);无缓存键/重试游标/去重键变化。 7. 是否改了设计方向:否。沿用既有 KDD#9 证据许可模式,无架构/边界/数据流转向。 8. 是否引入新的配置:无 config/env/CLI 新增。 Review 补强(已作为独立标注 commit 推入 PR 分支,head → 7c7ce2a)
验证汇总
判定:可合并。 修的是根本原因(结构识别替代会随上游预设漂移的启发式),方向、实现、测试三层都立得住;两处补强把「接线无 ungated 钉」和「guard 盲区」这两个同机制族的洞堵上了。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.207-master.c183076 # this exact build
npm install -g billion-context@master # always the newest merged build
|
…-lane suite The lane-guard (#2170, blind spot closed by #2554) requires a dedicated side-lane suite whenever src/server/handle.ts references a lane symbol. The google branch's !sideRequestLike gate legitimately trips it, so the pin must land with a side-lane suite edit. It belongs there anyway: side-request-isolation.test.ts now drives a dsh title-gen on the gemini wire through the proxy and pins that it rides the #388 verbatim passthrough (raw conversation key, no kernel state, no persona fork, anchor not stolen by an earlier side request). Removed the duplicate assertion from dsh-persona-fingerprint.test.ts.
Closes #2503
What changed (behavior-change disclosure)
dsh title-gen request lane: on dsh 0.2.1-alpha.2, title requests were treated as main turns — processed by the full pipeline under a forked persisted
|sub:<fp>ghost session (one minted per dsh session). After this PR they ride the #388 verbatim passthrough under the raw conversation key — i.e. rc2 behavior is restored.Root cause
dsh 0.2.1-alpha.2 raised the base-bundle preset
session-title-llm.maxOutputTokensfrom 64 → 4096 ("a ceiling against runaway output, not a length target — reasoning tokens count"). The value reaches the wire asmax_completion_tokens. bili's side-lane heuristic (SIDE_REQUEST_MAX_TOKENS = 200,src/server/side-request.ts) therefore stopped matching dsh title requests; with no persona header stamped, the request looked like a main turn and — under the #1916 dsh persona fingerprint — forked onto a persisted|sub:session instead of passing through.Wire evidence (hermetic fake upstream, real dsh binaries):
max_completion_tokensFix
Recognize the dsh title sidecar structurally — same evidence-per-client pattern as KDD#9 / #2500:
src/server/side-request.ts: new pure predicateisDshTitleRequest()+DSH_TITLE_SYSTEM_PREFIX(fixed first line of dsh's title system prompt, stable on the wire across rc2/alpha.2). Same no-tools veto asisSideRequestso no future main turn can be demoted through this path.src/server/handle.ts: conjunct gated onx-bili-plugin === "dsh"&& non-main intent at BOTH decision points —sideRequestLike(persona keying/fork) andsideIntent(+ newsideLabel: "dsh title-gen sidecar (#2503)"for the lane log).tests/dsh-title-side-lane.test.ts(new): truth cases for the predicate + the pre-fix gap pinned (isSideRequestmisses alpha.2 titles, catches rc2 ones).tests/side-lane-invariants.test.ts:isDshTitleRequestadded to the audit: 全仓冗余审计与重构计划——server.ts 解体、客户端矩阵去重、死代码、AGENTS.md 模块图腐化 #1440 handle.ts import allowlist (same category asisServerToolUtilityCall: pure predicate, no threshold/session state).Verification (rebased head bf2b48b)
|sub:), title forwarded verbatim with 4096,acp_statustool call round-trip intact. Log:side request (dsh title-gen sidecar (#2503)) → passthrough + tag strip only, kernel state untouched.ACP_TEST_E2E_DSH_NATIVE=1vs alpha.2: scenario A red before (found session-…|sub:c7c06ab4dd220c80, assertion at tests/e2e/e2e-native-dsh-persona.test.ts:386) → green after.Auto-merge gate self-assessment (§7.4)
Single-module scoped routing fix; regression test reproduces the original bug (gated e2e A red→green + unit cases); green on rebased head; no config schema / persistence / wire-shape / kernel change; pure
fix:; clean 4-file diff; references issue; no load-bearing infra touched → eligible.