Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5efa6ec
feat(dsh): opt-in overlay scope keeping the /compact command under bi…
Oct 26, 2026
77c60b0
docs: document dsh.keepCommandCompact / BILI_DSH_KEEP_COMMAND_COMPACT…
Oct 26, 2026
25eaa12
Merge remote-tracking branch 'origin/master' into pr4883-sync
Oct 26, 2026
337a658
fix(lifecycle): register BILI_DSH_KEEP_COMMAND_COMPACT in the LIFECYC…
Oct 26, 2026
995d1ed
Merge remote-tracking branch 'origin/master' into pr4883-sync
Oct 27, 2026
6f0ba1a
Merge remote-tracking branch 'origin/master' into pr4883-sync
Oct 27, 2026
76c45cd
Merge remote-tracking branch 'origin/master' into pr4883-sync
Oct 29, 2026
dcac090
Merge origin/ci-fixes into pr4883-sync: converge 5 guard lanes onto n…
Oct 30, 2026
d15ab28
Merge origin/master into pr4883-sync: pick up trailing revert (#4883 …
Oct 30, 2026
71c2b7c
Merge remote-tracking branch 'origin/master' into pr4883-sync
Oct 31, 2026
2470631
Merge remote-tracking branch 'origin/master' into pr4883-sync
Oct 31, 2026
d61d472
merge: resolve origin/master into PR #4883 (keepCommandCompact)
Nov 12, 2026
62e0c20
merge: resync origin/master into PR #4883 (keepCommandCompact)
Nov 12, 2026
b8821bf
merge: resync origin/master into PR #4883 (keepCommandCompact)
Nov 13, 2026
148dbb3
merge: resync origin/master into PR #4883 (keepCommandCompact) — pick…
Nov 13, 2026
9496a6d
merge: converge origin/ci-fixes into PR #4883 (inherited-red: notice-…
Nov 13, 2026
eb8c097
feat(dsh): visible /compact stub when the bili gate stands the comman…
Nov 15, 2026
571c365
merge: converge origin/master into PR #4883 (resolve dsh-native.ts im…
Nov 19, 2026
69f2cd6
merge: converge origin/master (04ecbb42dd3) into PR #4883 (resolve ds…
Nov 19, 2026
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
26 changes: 19 additions & 7 deletions docs/clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,31 @@ Two lanes, same plugin (#941):
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
`compaction-basic` rows — and `command-compact` rows unless
`dsh.keepCommandCompact` is set (#4872) — `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 — 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);
unavailable there by default — 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 for AUTO-compaction by design (#3651/#3666).
While the knob is unset, bili registers a visible `/compact` stub in
these profiles so a typed `/compact` is answered — never silently
demoted to a plain model message (#6814) — pointing at /acp and at
the knob. If you run third-party plugins bridging through the
DSH-official `ctx.commands.find(agent, "compact")` path and need the
explicit `/compact` command back, set `dsh.keepCommandCompact` (env
`BILI_DSH_KEEP_COMMAND_COMPACT`) — the overlay then disables only
compaction-basic, and a `/compact`-triggered call still passes the
#1729 wire guard; see configuration.md, #4872);
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
`compaction-basic`/`command-compact` rows enters the rewrite (always
for compaction-basic, additionally for command-compact while
`dsh.keepCommandCompact` is unset, #4872), 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]`
Expand Down
2 changes: 1 addition & 1 deletion docs/clients.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- **桌面应用(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 在**加载期**补上这一环:一个**常驻**的 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]` 日志,说明两条路径。
- **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` 行(以及未设 `dsh.keepCommandCompact` 时的 `command-compact` 行,#4872)标记为 `disabled: true`;#4147 起该匹配是**结构化**的 —— 任何 entry 的 `config.plugins` 里嵌套了这两个包的行都会进入改写(compaction-basic 恒禁,command-compact 仅在未设 `dsh.keepCommandCompact` 时禁,#4872),自定义/本地 preset 与官方 preset 一视同仁(`dsh.bundle.patch.yml` 里的四个门控 id 只是对官方 roster 的顺序保险,不是覆盖边界);bundle patch 里的 preset 门控行让每个 Web preset 在注册前等待该 overlay 的服务。这些 profile 里原生自动压缩同样关闭(且 `/compact` 在那里默认不可用 —— 这是**预期行为而非 bug**(#4002):该泳道的压缩由 bili 接管,preset 的 compact 命令与自动压缩默认被有意一并撤下;**自动压缩**按设计**没有**重新打开的开关(#3651/#3666)。开关未设时,bili 在这些 profile 里注册一个可见的 `/compact` 占位命令:输入的 `/compact` 会得到明确答复(指向 /acp 与该开关),而**不会**被静默降级为普通模型消息(#6814)。若你运行依赖 DSH 官方 `ctx.commands.find(agent, "compact")` 通路的第三方插件、需要显式 `/compact` 命令,设 `dsh.keepCommandCompact`(env `BILI_DSH_KEEP_COMMAND_COMPACT`)——overlay 便只禁 compaction-basic;/compact 触发的调用仍经 #1729 wire guard(#4872),见 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 实际加载了哪份。

Expand Down
Loading
Loading