Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 49 additions & 10 deletions CLIENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,31 @@ Two lanes, same plugin (#941):
No patch layer can address that NESTED row by id — dsh's patch engine
indexes only top-level rows and true group children — so the bundled
`auto: false` lands on web-app's already-disabled host-plane row and
changes nothing. Since #3354 bili closes the gap at LOAD TIME: the
`bili-native` bundle entry registers a cordis `internal/config` overlay
(vendored from deshark42/dsh-compaction-basic-disable, MIT) that marks
the preset's `compaction-basic` and `command-compact` rows
`disabled: true`, and the preset gate rows in the bundle patch make each
Web preset wait for that overlay before it can register. Native
changes nothing. Since #3354 bili closes the gap at LOAD TIME: an
always-on bundle entry `bili-compaction-gate` — a separate cordis entry
beside `bili-native`, mounted by the same patch layers, so it stays
alive when `bili-native` is disabled or kill-switched (#3662) —
registers a cordis `internal/config` overlay (vendored from
deshark42/dsh-compaction-basic-disable, MIT) that marks the preset's
`compaction-basic` and `command-compact` rows `disabled: true` while
bili owns the lane, and the preset gate rows in the bundle patch make
each Web preset wait for that overlay's service before it can register.
Native
auto-compaction is OFF in these profiles too (and `/compact` is
unavailable there); ACP compression is unaffected. The overlay rides an
unavailable there — that is EXPECTED, not a bug (#4002): bili owns
compression on the lane, so the preset's compact command and its
auto-compaction are both stood down deliberately; there is no
re-enable switch by design (#3651/#3666), see CONFIGURATION.md);
ACP compression is unaffected. Since #4147 the overlay matches
STRUCTURALLY — any entry whose resolved `config.plugins` nests
`compaction-basic`/`command-compact` rows gets them disabled, custom
and profile-local presets exactly like the factory ones (the four
gate-row ids in `dsh.bundle.patch.yml` are ordering insurance for the
factory roster, not the coverage boundary — a profile shipping other
preset ids is covered by the structural walk). The one-time `[dsh-client]`
boot note names the actual entries the overlay rewrote (#3962), so a
patch-row miss on a renamed roster is visible without reading the host
loader log. The overlay rides an
INTERNAL dsh hook and is version-sensitive — if you still see a dsh
compaction checkpoint land on a newer/older dsh build, fall back to the
#2474 recipe: a profile-level patch (your profile's `cordis.patch.yml`,
Expand All @@ -118,9 +135,31 @@ Two lanes, same plugin (#941):
leave the preset unrecognized by the roster — and `- insert:` with the
same id appends a second dead row instead of merging. The snapshot also
freezes the roster until re-copied after a dsh preset update. The plugin
logs a one-time `[dsh-client]` note naming both paths at boot in such
profiles.
- **Global copy shadows the profile copy at load time (#2891):** dsh resolves
logs a one-time `[dsh-client]` note naming both paths at boot in such
profiles.
- **Disabling vs removing the plugin (#3662):** pre-#3662, disabling
`bili-native` (dsh plugin manager, or `disabled: true` in any patch
layer) removed the ONLY provider of the gate service while the preset
rows kept waiting on it — all four Web presets stayed pending forever
and every new/resumed session failed with
`Unknown agent preset: standard`. The service now lives in the
separate always-on `bili-compaction-gate` entry: disabling or
kill-switching (`BILLION_CONTEXT_PLUGIN=0`) `bili-native` hands the
lane back to STOCK dsh behavior — presets boot normally and native
auto-compaction returns; compression is simply off. Do NOT disable
`bili-compaction-gate` itself — that re-creates the brick. To fully
uninstall, remove `billion-context` from the profile's
`dsh.profile.bundles` (and its dependency) and restart: the whole
patch layer disappears and `compaction-basic` returns to stock
`auto: true`. If you are stuck on a pre-#3662 version with the plugin
already disabled, upgrading self-heals (the patch layer mounts from
whatever package is listed in bundles, regardless of `bili-native`'s
state); the manual un-brick is appending four rows to the HOME-layer
patch `$DSH_HOME/cordis.patch.yml` (`~/.dsh/cordis.patch.yml` when
`DSH_HOME` is unset) — `- id: preset-standard` / `preset-ptc` /
`preset-minimal` / `preset-cordis`, each with `inject: null`. Top-level
keys are replaced wholesale, clearing the pending latch.
- **Global copy shadows the profile copy at load time (#2891):** dsh resolves
the bare `billion-context` name in `dsh.profile.bundles` installation-
anchor-first — from its own install tree (the global npm root) before the
profile's `node_modules`. So if a machine-global `billion-context` exists
Expand Down
3 changes: 2 additions & 1 deletion CLIENTS.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
- **桌面应用(Electron 宿主):** 同一插件也运行在 deepseek-harness **desktop** 应用内(经其应用内插件管理器安装)。此时 bootstrap 在应用进程内拉起代理:该进程的 `process.execPath` 是 Electron 二进制而非 Node,GUI 的 PATH 又不含常规安装目录 —— `resolveNodeRuntime`(#819/#1429)先探测众所周知的安装位置(`/opt/homebrew/bin`、`/usr/local/bin`、Volta 等),再回退到以纯 Node 方式运行应用自身二进制(`ELECTRON_RUN_AS_NODE=1`,强制注入子进程 env),于是无需 PATH 里有独立 Node 也能零配置压缩;设 `BILLION_CONTEXT_NODE` 可强制指定某个 Node(优先于两者)。#1429 之前该路径在 spawn 前抛错,所有会话静默降级为直连(不压缩),只能从 bili.log 里发现。
- **自动更新保持各 profile 同步:** 刷新有两个触发器 —— 全局自更新完成后,以及**profile 自己的代理**在周期检查里发现注册表有新版本时(全局 bili 从不运行也一样刷新,#1196 —— 插件市场安装的用户往往根本没有全局安装)。两种触发器都扫描 `~/.dsh/profiles/*/package.json`,把注册表钉住的 `billion-context` 依赖刷新到目标版本(全局触发器刷到新全局版本,自触发刷到注册表最新),统一经 dsh 自己的 `plugin add` 通道,绝不在位覆盖 —— 加载的插件与代理从此不再漂移(#953);钉在本地源的 profile 不动。刷新是尽力而为,失败下个周期重试,绝不会让代理或更新本身失败。
- **已报告:Profile 安装下部分传输零代理流量(#1158,调查中):** dsh `llm-pi-ai` 层的部分传输服务会话**从未有任何模型请求到达代理**(日志无 `processTurn`,调用 bili 工具返回 404 "no model request has arrived"),而同宿主的其他 provider 正常。根因仍在用运行时证据定性 —— 候选:传输层 fetch 形态(SDK 注入 fetch / 非全局 dispatcher)或宿主侧归属缺口导致流量未被 takeover gate 认领。检测:此类情况会打一次性 `[plugin] NO MODEL REQUESTS seen for conversation …` 告警,dsh 插件还会把归属 gate 放行的每个端点各记一条日志(每进程一次)。期间可靠规避:改用 `bili dsh` 启动 —— 启动器的 settings overlay 会把那些 provider 的 `baseURL` 重写为 `/bili/` URL,无论传输层使用哪种 fetch、归属状态如何,流量都必然过代理。
- **Web profile 压缩(#1772,#3354 解决):** 当 profile 的 bundles 含 `@deepseek-ai/dsh-web-app` 时,真正运行的 `compaction-basic` 实例位于 agent preset(`preset-standard.config.plugins`)内部 —— dsh 的 patch 引擎只按 id 索引顶层条目与真 group(`group: true` 且 config 为数组)的子项,preset 内的嵌套行任何 patch 层都无法**按 id 直寻**。于是 bundle 里的 `auto: false` 落在 web-app 已禁用的宿主平面行上、什么都没改。#3354 起 bili 在**加载期**补上这一环:`bili-native` bundle 条目注册一个 cordis `internal/config` overlay(移植自 deshark42/dsh-compaction-basic-disable,MIT),把 preset 里的 `compaction-basic` 与 `command-compact` 行标记为 `disabled: true`;bundle patch 里的 preset 门控行让每个 Web preset 在注册前等待该 overlay。这些 profile 里原生自动压缩同样关闭(且 `/compact` 在那里不可用);ACP 压缩不受影响。overlay 依赖 dsh 的内部钩子、对版本敏感 —— 若在新/旧 dsh 构建上仍见到 dsh 压缩 checkpoint 落地,回退到 #2474 配方:profile 层 patch(你 profile 自己的 `cordis.patch.yml`,在所有 bundle 之后生效)用同 id + **完整快照** `config` 整体覆盖 preset-standard —— 从 `dsh --profile <name> --dump-config` 抄下完整的 preset config,在其 `compaction-basic` 行下加 `config.auto: false`,把结果追加进 `cordis.patch.yml`。Config 替换是**整体语义**(片段会静默丢掉一切未重述的键 —— 不只是其他插件,连 preset 自己的 `id`/`order` 身份也会丢,可能使 roster 无法识别该 preset);`- insert:` 同 id 则是在末尾追加一条死行而非合并。dsh 升级 preset 后快照冻结 roster、需重抄一次。此类 profile 启动时插件打一条一次性 `[dsh-client]` 日志,说明两条路径。
- **Web profile 压缩(#1772,#3354 解决):** 当 profile 的 bundles 含 `@deepseek-ai/dsh-web-app` 时,真正运行的 `compaction-basic` 实例位于 agent preset(`preset-standard.config.plugins`)内部 —— dsh 的 patch 引擎只按 id 索引顶层条目与真 group(`group: true` 且 config 为数组)的子项,preset 内的嵌套行任何 patch 层都无法**按 id 直寻**。于是 bundle 里的 `auto: false` 落在 web-app 已禁用的宿主平面行上、什么都没改。#3354 起 bili 在**加载期**补上这一环:一个**常驻**的 bundle 条目 `bili-compaction-gate`(与 `bili-native` 并列的独立 cordis 条目,由同一组 patch 层挂载,因此 `bili-native` 被禁用或 kill-switch 时它仍然存活,#3662)注册一个 cordis `internal/config` overlay(移植自 deshark42/dsh-compaction-basic-disable,MIT),在 bili 持有该泳道期间把 preset 里的 `compaction-basic` 与 `command-compact` 行标记为 `disabled: true`;#4147 起该匹配是**结构化**的 —— 任何 entry 的 `config.plugins` 里嵌套了这两个包的行都会被禁用,自定义/本地 preset 与官方 preset 一视同仁(`dsh.bundle.patch.yml` 里的四个门控 id 只是对官方 roster 的顺序保险,不是覆盖边界);bundle patch 里的 preset 门控行让每个 Web preset 在注册前等待该 overlay 的服务。这些 profile 里原生自动压缩同样关闭(且 `/compact` 在那里不可用 —— 这是**预期行为而非 bug**(#4002):该泳道的压缩由 bili 接管,preset 的 compact 命令与自动压缩被有意一并撤下;按设计**没有**重新打开的开关(#3651/#3666),见 CONFIGURATION.md);ACP 压缩不受影响。启动的一次性 `[dsh-client]` 日志会列出 overlay 实际改写过的 entry(#3962),patch 行落空(如 roster 改名)无需翻宿主 loader 日志即可见。overlay 依赖 dsh 的内部钩子、对版本敏感 —— 若在新/旧 dsh 构建上仍见到 dsh 压缩 checkpoint 落地,回退到 #2474 配方:profile 层 patch(你 profile 自己的 `cordis.patch.yml`,在所有 bundle 之后生效)用同 id + **完整快照** `config` 整体覆盖 preset-standard —— 从 `dsh --profile <name> --dump-config` 抄下完整的 preset config,在其 `compaction-basic` 行下加 `config.auto: false`,把结果追加进 `cordis.patch.yml`。Config 替换是**整体语义**(片段会静默丢掉一切未重述的键 —— 不只是其他插件,连 preset 自己的 `id`/`order` 身份也会丢,可能使 roster 无法识别该 preset);`- insert:` 同 id 则是在末尾追加一条死行而非合并。dsh 升级 preset 后快照冻结 roster、需重抄一次。此类 profile 启动时插件打一条一次性 `[dsh-client]` 日志,说明两条路径。
- **禁用与移除插件的区别(#3662):** #3662 之前,禁用 `bili-native`(dsh 插件管理器,或任何 patch 层里写 `disabled: true`)会把门控服务的**唯一**提供方一并移除,而 preset 行仍在等它 —— 四个 Web preset 永久 pending,新建/恢复会话全部报 `Unknown agent preset: standard`。现在该服务住在独立的常驻条目 `bili-compaction-gate` 里:禁用或 kill-switch(`BILLION_CONTEXT_PLUGIN=0`)`bili-native` 只是把泳道交还 dsh **原生行为** —— preset 正常注册、原生自动压缩恢复,bili 压缩则完全关闭。请勿禁用 `bili-compaction-gate` 本身 —— 那会重新造成「砖」。要彻底卸载:从 profile 的 `dsh.profile.bundles`(及其依赖)里移除 `billion-context` 后重启 —— 整个 patch 层消失,`compaction-basic` 回到原生默认 `auto: true`。若卡在 #3662 之前的版本且插件已被禁用:升级即自愈(patch 层按 bundles 里列出的包装载,与 `bili-native` 的启用状态无关);手动解砖是在 HOME 层 patch `$DSH_HOME/cordis.patch.yml`(`DSH_HOME` 未设时为 `~/.dsh/cordis.patch.yml`)追加四行 `- id: preset-standard` / `preset-ptc` / `preset-minimal` / `preset-cordis`,各配 `inject: null` —— 顶层键为整体替换,清掉 pending 锁。
- **全局副本在加载期抢占 profile 副本(#2891):** dsh 解析 `dsh.profile.bundles` 里的裸包名 `billion-context` 时是 installation-anchor-first —— 先在自己的安装树(全局 npm root)里找,再找 profile 的 `node_modules`。因此只要机器上存在一份全局 `billion-context`,dsh 就加载**全局那份**,profile 里装的被静默忽略 —— 不崩溃、无日志。两者版本不一致时,实际运行的可能与 profile 声明的不同(例如 #1590 之前的全局没有 `dsh.client` web 面,设置页菜单凭空消失)。这一事实默认情况下处处不可见:`bili doctor` 现在会按 profile 逐一标记任何版本不一致的全局/本地对(#2891);用 `dsh --profile <name> --dump-config`(读该 bundle 的 `name:` 行)可核对 dsh 实际加载了哪份。

`bili dsh` 启动下插件**附看**(attach)启动器的代理(不二次拉起)。裸上游 URL 与 spawn 模式一样重写为 `<proxy>/bili/<url>`(回环代理目标永不被代理 env 拦截,等于直接绕开 MITM);已经路由的 `/bili/` 前缀请求原样放行、只盖章。已知局限:手动 `/compact` 没有 dsh 侧事件钩子,其边界交给内核的自然 ingest diff(自动压缩现已处处关闭 —— 宿主平面经 bundle patch,web profile 的 preset 经 #3354 加载期 overlay;见上方 Web profile 说明)。
Expand Down
4 changes: 3 additions & 1 deletion CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2248,10 +2248,12 @@ Two compressors on one conversation double-compress and corrupt message refs, so

#### Turning dsh native auto-compaction OFF in a web profile (#1772/#3354, automatic since #3354; #2474 recipe as fallback)

**Automatic since #3354.** In a profile bundling `@deepseek-ai/dsh-web-app` the running compaction-basic instance lives inside an agent preset (`preset-standard.config.plugins`) where no patch layer can address the nested row by id (#1772) — the bundled `- id: compaction-basic` row lands on web-app's already-disabled host-plane row and changes nothing. bili now closes that gap at LOAD TIME: the `bili-native` bundle entry registers a cordis `internal/config` overlay (vendored from [deshark42/dsh-compaction-basic-disable](https://github.com/deshark42/dsh-compaction-basic-disable), MIT) that marks the preset's `compaction-basic` and `command-compact` rows `disabled: true`, and the preset gate rows in `dsh.bundle.patch.yml` / the launcher overlay make each Web preset wait for that overlay before it can register. Native auto-compaction is off in these profiles with no user action; ACP compression is unaffected.
**Automatic since #3354.** In a profile bundling `@deepseek-ai/dsh-web-app` the running compaction-basic instance lives inside an agent preset (`preset-standard.config.plugins`) where no patch layer can address the nested row by id (#1772) — the bundled `- id: compaction-basic` row lands on web-app's already-disabled host-plane row and changes nothing. bili now closes that gap at LOAD TIME: an always-on bundle entry `bili-compaction-gate` — a separate cordis entry beside `bili-native`, mounted by the same patch layers, so it stays alive when `bili-native` is disabled or kill-switched (#3662) — registers a cordis `internal/config` overlay (vendored from [deshark42/dsh-compaction-basic-disable](https://github.com/deshark42/dsh-compaction-basic-disable), MIT) that marks the preset's `compaction-basic` and `command-compact` rows `disabled: true` while bili owns the lane, and the preset gate rows in `dsh.bundle.patch.yml` / the launcher overlay make each Web preset wait for that overlay's service before it can register. Native auto-compaction is off in these profiles with no user action; ACP compression is unaffected.

The overlay rides an INTERNAL dsh hook and is version-sensitive. If you still see a dsh compaction checkpoint land on a newer/older dsh build, use the fallback below.

**Disabling vs removing (#3662).** Disabling `bili-native` (dsh plugin manager or `disabled: true` in a patch layer) no longer bricks session creation: the gate service survives in the separate always-on `bili-compaction-gate` entry, so the presets fall back to STOCK native compaction instead of pending forever — compression off, dsh fully usable. Never disable `bili-compaction-gate` itself (that re-creates the brick); to fully uninstall remove `billion-context` from the profile's `dsh.profile.bundles` and restart. Pre-#3662 installs left bricked self-heal on upgrade; manually, append `- id: preset-standard` / `preset-ptc` / `preset-minimal` / `preset-cordis`, each with `inject: null`, to `$DSH_HOME/cordis.patch.yml` (home layer; default `~/.dsh/cordis.patch.yml`) — top-level keys replace wholesale, clearing the pending latch.

**Fallback recipe (#2474)** (verified on dsh `0.2.1-alpha.1`, Windows 11, profile bundles including `@deepseek-ai/dsh-web-app`). A profile-layer patch can turn it off — presets are ordinary top-level rows inserted by the bundle layer, and the profile patch layer is applied after it. What does not work is addressing the nested row by id; what does work is overriding the preset row's `config` wholesale.

```bash
Expand Down
Loading
Loading