Repository navigation
[PR] fix: keep dsh presets bootable when bili-native is disabled (#3662) - #3729
Conversation
691f9e0 to
e6a87e4
Compare
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4970-pr.3729.b7117e5This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3729.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 上游 PR 冲突已解决:分支 八问
备注:本地 |
e6a87e4 to
1fea506
Compare
1fea506 to
cf332a2
Compare
(ai: vllm-qwen/qwen3.8-27b) 标签: bug / dsh / scope/wiring / p1 —— 禁用 dsh 插件后新建/恢复会话完全不可用(用户不能用),修复点在客户端接线层。 以下是对 diff 的独立重审(未照抄 PR 描述),本地已复现全部关键路径:npm ci + build、typecheck、4 个定向测试套件(398 pass / 0 fail)、两条 gate 脚本本地实跑。 ① 方向关(原 issue)根因定位正确:静态补丁层(看不到运行时状态)把 4 个 web preset 的启动锁在 ② 回归审查(逐项过既有行为)
一个我独立发现的竞态窗口(非阻塞):dsh 对兄弟入口并行 import,gate 若先于 bili-native 的 另核了一处不对称:URL lane 无条件写 gate 的 file:// URL(src/launcher.ts:3182),而 shim lane 有存在性守卫。病态分裂态(dist 缺 gate bundle)下两者结果等价(服务都不可提供 ⇒ 旧式 pending),且 file:// 指向缺失文件是响亮失败而非静默跳过,该状态几乎不可达(同一构建产物)。不改,不立项,记录理由于此。 ③④ 代码与测试代码干净:verdict 通道(globalThis key CI 状态与一处已修复的红旧 head 结构化八问
判定:可合 —— 待新 head |
(ai: vllm-qwen/qwen3.8-27b) CI 终判(最终 head 审核期间分支被 rebase 到当前 master(新 head 最终 head 上的完整 CI 结果(30 success / 14 skipped / 0 failure):
判定维持:可合。 八问结论与回归审查见上一条回复;无新增发现。 |
Disabling or kill-switching the dsh plugin removed the only provider of biliBasicCompactionPolicy while the bundle patch kept gating all four web-profile presets on it — every preset stayed pending forever and new/ resumed sessions failed with "Unknown agent preset: standard". The load-time overlay + gate service now live in their own always-on cordis entry (bili-compaction-gate), mounted alongside bili-native by both patch carriers (dsh.bundle.patch.yml, launcher overlay). The entry registers the transform and provides the service atomically (the #3354 ordering guarantee survives the split); whether it disables the preset compaction rows is decided per process by a verdict bili-native sets from apply() — an absent verdict (entry disabled, kill-switched, module failed to load) leaves every row stock. Behavior changes: - disabling/kill-switching bili-native: presets used to pend forever (session creation bricked); they now boot with STOCK native compaction — compression off, dsh fully usable. - bili-native module failing to load: previously a deliberate fail-safe brick; now falls back to stock with the #1729 wire-level refusal guard as backstop (availability over fail-safe-brick). - new visible cordis entry bili-compaction-gate; disabling IT re-creates the pending state (documented in bundle patch header + CLIENTS / CONFIGURATION en+zh). Full uninstall: remove billion-context from dsh.profile.bundles. Closes #3662
…rface real coverage (#4147/#3962/#4002) #4147: the #3354 load-time overlay matched the factory @deepseek-ai/dsh-agent-preset entry by name, leaving custom and profile-local presets' nested compaction-basic/command-compact rows ARMED — a landed dsh checkpoint then destroyed the compression substrate (#4147 consequence A). The transform now matches STRUCTURALLY: any entry whose resolved config.plugins nests a compaction row gets those rows disabled; entries without them keep their resolved config object identity untouched. #3962: every rewrite is recorded on the shared globalThis telemetry channel (covered entries + row counts + factory flag) and the durable [dsh-client] boot notes append the actual coverage, so bundle-patch gate rows missing a renamed roster are visible without the host loader log. #4002: CLIENTS.md en+zh state that preset sessions have no /compact menu by design (bili owns compression; no re-enable switch, #3651). Rebased onto current master (594 commits) — resolves the dsh-native/issue3354/tsup conflicts by union.
cf332a2 to
69cf200
Compare
|
(ai: zhipuai-lb/glm-5.3) Cluster update pushed to this PR's branch (
Local: typecheck clean; 5 targeted suites 414/0/0; PR body updated with the cluster section; Closes #3662/#4147/#3962/#4002. |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.729-master.9284a88 # this exact build
npm install -g billion-context@master # always the newest merged build
|
… rows (#3962) dsh.bundle.patch.yml gates four Web presets (preset-standard / preset-ptc / preset-minimal / preset-cordis) on ids that exist only in the FACTORY roster. A profile that replaces them with its own ids matches none of the four rows and dsh logs `patch: entry <id> not found` at startup — buried in the loader logger, surfaced nowhere else. From the outside the rows read as "working" when they are silent no-ops. State the roster-conditionality in the patch file itself (the shipped artifact users inspect): the miss is NOT harmless — an ungated custom preset resolves by import order and may win the race against the overlay middleware register, leaving its compaction-basic AND command-compact rows armed (timing window; worst case a dsh checkpoint outside bili destroys the compression substrate, #3354/#1772/#1729). Mitigation: self-gate each custom preset entry with inject:[biliBasicCompactionPolicy]. Self-check: grep the dsh loader log for `patch: entry ... not found`. Do-not-delete note kept: factory-roster profiles get a real ordering fence from these rows. The launcher overlay carrier (writeDshAcpPatch) mirrors the same clause so the two carriers stay in sync (file's own discipline + #3354 carrier-agreement test). Comments/string-literal only — zero behavior change: no functional patch row is added, removed, or reworded. Rebased onto master after #3729 landed (gate moved to its own always-on bili-compaction-gate entry; structural matching + coverage telemetry shipped there). The four gate rows are unchanged on master, and structural matching widens WHICH entries the transform reaches but not WHEN the middleware registers relative to an ungated preset's resolution — the timing window this note documents persists, so the text needs no rewording. Targeted suites green locally: issue3354-dsh-compaction-disable (incl. two-carriers-agree), issue2605-dsh-retry-patch, issue4147-dsh-overlay-structural (16/16). Full typecheck/test on CI. References #3962
(ai: vllm-qwen/qwen3.8-27b)
What this fixes
Disabling the plugin in dsh (plugin manager, or
disabled: truein any patch layer) permanently bricked session creation: all four web-profile presets stayedpending (waiting for service: biliBasicCompactionPolicy), because the ONLY provider of that service was the verybili-nativeentry being disabled — while the static bundle patch kept gating them on it. The env kill-switch (BILLION_CONTEXT_PLUGIN=0) hit the same path. New/resume then failed withUnknown agent preset: standard; only removing the package fromdsh.profile.bundlesrecovered.Approach
Split the gate out of
bili-nativeinto its own always-on cordis entrybili-compaction-gate(new tsup entry +./dsh-compaction-gateexport), mounted alongsidebili-nativeby BOTH patch carriers (dsh.bundle.patch.yml, launcher.bili-acp.patch.yml; the client shim gains the subpath export for the bare lane).internal/configtransform AND provides the service atomically — the See how to integrate the plugin that automatically disables dsh compression. | 自动关闭 dsh 压缩的插件看如何集成 #3354 ordering guarantee (transform live before the latch can be satisfied) survives the split unchanged.bili-nativesets fromapply()(globalThis channel — the two entries are separate bundles / module instances). Absent verdict = bili-native never ran ⇒ every row passes through STOCK.compaction-basic auto: falserow stays where it is (non-web profiles: compression off, manual/compactrefused via nudge 死锁无检测:同一 session 交替收到两种结构互斥的请求流(巨型单消息 ↔ 多轮)时不告警 #1729 — unchanged).Behavior changes (old → new)
bili-nativedisabled / kill-switchedbili-nativemodule fails to loadbili-native)bili-compaction-gatemust NOT be individually disabled (re-creates the brick) — documented in bundle patch header + CLIENTS/CONFIGURATION en+zhResidual footgun (accepted): disabling
bili-compaction-gateitself re-creates the old pending state; docs point at uninstall viadsh.profile.bundlesremoval instead. Pre-fix bricked installs self-heal on upgrade (the patch layer mounts from whatever package is listed in bundles, regardless ofbili-native's state); manual un-brick recipe documented ($DSH_HOME/cordis.patch.yml, fourinject: nullrows —$DSH_HOMEper issue comment, defaulting to~/.dsh).Tests
tests/issue3662-dsh-gate-fallback.test.ts: gate surface; BRICK scenario (absent verdict ⇒ service still provided, ordering intact, transform passes rows through stock); normal boot (verdict active ⇒ rows disabled); verdict channel semantics; both patch carriers mount the gate (bundle yml + bare lane + URL lane).tests/issue3354-dsh-compaction-disable.test.ts: transform test now runs under an explicit verdict; carrier agreement pins the gate insert block in both layers.tests/dsh-native.test.ts:apply()asserts the verdict instead of overlay registration (active plan sets it; kill switch neither registers nor declares it).tests/launcher.test.ts: overlay assertions pin the gate row in both lanes; shim tests cover the subpath export + symlink and the missing-gate-bundle degradation (no dangling symlink).check:unused-exports+check:test-import-graphclean; full suite on CI.Cluster update (2026-10-21): rebased + encompasses #4147 / #3962 / #4002
(ai: zhipuai-lb/glm-5.3) — this section; owner-directed one-PR treatment of the dsh.bundle.patch.yml cluster (discussion #3916, group ①).
Rebased onto current master (was 594 commits behind; conflicts in
src/agent/dsh-native.ts,tests/issue3354-dsh-compaction-disable.test.ts,tsup.config.tsresolved by union — master's #3806 overlay-gap alarm and conversation-recall imports kept, the gate entry + verdict wiring kept).#4147 (p1) — structural matching. The transform matched only the factory
@deepseek-ai/dsh-agent-presetentry by name, so custom/profile-local presets' nestedcompaction-basic/command-compactrows stayed ARMED and a landed dsh checkpoint destroyed the compression substrate (reporter session a391: 128 refused calls,native-compaction-inferred: substrate destroyed). The middleware now walks ANY entry's resolvedconfig.plugins; rows are disabled wherever they nest; entries without compaction rows keep their resolved config object identity. The four patch gate-row ids remain as ordering insurance for the factory roster, not the coverage boundary.#3962 — coverage telemetry. Every rewrite is recorded on the shared globalThis channel (
dshCompactionGateTelemetry(): covered entries × row counts, factory flag). The durable[dsh-client]boot notes (web + non-web branches) append actual coverage, so a patch-row miss on a renamed roster is visible without the host loader log. Waiver added incheck-unused-exportsfor the channel payload type (same rationale as #3754).#4002 (p3, direction 2) — docs. CLIENTS.md en+zh now state preset sessions have no
/compactmenu BY DESIGN (bili owns compression; no re-enable switch per #3651/#3666) and describe the structural coverage + the coverage note.Tests: new
tests/issue4147-dsh-overlay-structural.test.ts(5 cases: custom preset + group recursion, negative identity/absent-verdict, telemetry dedup/max/factory/reset, name truncation); both existing negative-assertion rows flipped to the structural semantics (entries without compaction rows still pass verbatim). Targeted: typecheck clean, 5 suites 414 pass / 0 fail, unused-exports + test-import-graph + build clean. Full-suite verdict: CI test lanes on the pushed head.Closes #3662
Closes #3889
Closes #4147
Closes #3962
Closes #4002