diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 4fc29404f5..92bd1b0681 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -2061,6 +2061,68 @@ Two compressors on one conversation double-compress and corrupt message refs, so - **Where findings surface:** launcher stderr before the client starts; a proxy warn log on each session's first request (client identified from the `x-bili-plugin` header or wire headers); and the session's conflict ledger — `acp_status`'s `COMPRESSION CONFLICTS` section, `GET /__bili/stats` → `conflicts`, web-UI banner. - **Runtime evidence:** unannounced history rewrites (#1001) and orphan-gc deactivations (summarized content deleted out of the client's history) are recorded in the same ledger, so *suspected* coexistence and *observed* interference cross-check each other. - **dsh's `auto: false` disables only the automatic triggers.** The `compaction-basic: { auto: false }` line installed by the profile bundle patch (`dsh.bundle.patch.yml`) skips pressure/overflow auto-compaction — a manual `/compact` (and idle-session compaction) still fires. Calls routed through bili are refused by the server-side guard (#1729/#2360); calls that reach the provider without transiting bili (desktop-lane paths the plugin's takeover gate does not attribute) land, and bili detects them on the next replay — checkpoint framing + decimated fold coverage — rebasing its compression state in one turn instead of failing every later compress forever (#2432). + +#### Turning dsh native auto-compaction OFF in a web profile (#1772/#2474) + +The bundled `dsh.bundle.patch.yml` cannot do this: in a profile bundling `@deepseek-ai/dsh-web-app` its `- id: compaction-basic` row lands on web-app's **host-plane row, which is already `disabled: true`**, while the instance that actually runs lives inside `preset-standard.config.plugins`. The patch applies silently and changes nothing. + +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. + +**Recipe** (verified on dsh `0.2.1-alpha.1`, Windows 11, profile bundles including `@deepseek-ai/dsh-web-app`): + +```bash +# 1. Dump the composed profile and copy preset-standard's COMPLETE config block. +dsh --profile --dump-config > /tmp/profile.yml +``` + +2. Append a `preset-standard` row to `$DSH_HOME/profiles//cordis.patch.yml` containing that **complete** `config` — every one of its `plugins` entries, byte-for-byte — with exactly one change: add `config: { auto: false }` under the `compaction-basic` row inside the `compaction` group. + +```yaml +- id: preset-standard + name: '@deepseek-ai/dsh-agent-preset' + config: + id: standard + order: 1 + plugins: + # … every entry from the dump, unchanged … + - id: compaction + name: cordis:group + group: true + isolate: + compaction: true + toolResultPruner: true + config: + - id: compaction-basic + name: '@deepseek-ai/dsh-compaction-basic' + config: + auto: false # ← the only delta + - id: command-compact + name: '@deepseek-ai/dsh-command-compact' + - id: tool-result-pruner + name: '@deepseek-ai/dsh-compaction-tool-result-pruner' + config: + thresholdChars: 8192 + headChars: 4096 + tailChars: 1024 + # … every remaining entry, unchanged … +``` + +3. Confirm before relying on it: `dsh --profile --dump-config | grep -A2 'id: compaction-basic'` — the entry count of `preset-standard` must be **unchanged** and the nested row must now carry `config.auto: false`. + +Automatic pressure/overflow compaction is off; manual `/compact` and the tool-result pruner stay on. Repeat the same shape for `preset-ptc` / `preset-cordis` if sessions use those presets (`preset-minimal` ships no `compaction` group). + +**Three ways to get this wrong — all silent** (measured against the same dump): + +| Patch form | Result | +|---|---| +| `- id: preset-standard.compaction.compaction-basic` | `patch: entry "…" not found`; **no effect** | +| `- id: preset-standard` + a partial `config.plugins` | `config` is **replaced, not merged** — the preset collapses to just the entries you wrote (35 → 3 in the measured case): no persona, no tools | +| `- insert:` with `id: preset-standard` | appends a **second** `preset-standard` row at the tree tail; the live preset is untouched | +| full `config` snapshot + one `auto: false` | ✅ entry count unchanged, only delta is `auto: false` | + +**The snapshot is frozen at the dsh version you copied from.** Unlike a bundle-layer patch, a profile-layer `config` is a point-in-time copy: after a dsh upgrade adds, removes, or reconfigures a row inside the shipped preset, this override keeps serving the old roster — new plugins silently never load. Re-run step 1, diff the new `preset-standard` block against the one in your patch, and re-copy it whole whenever that section changes. If you would rather not maintain a snapshot, leave native auto-compaction on and let the #1729/#2432 rebase path handle the interaction instead. + +Because a partial override fails without any diagnostic, always re-dump and compare entry counts after editing. - Under the opencode launcher/native mode a present `opencode-acp` is info-only by design (#920 absorbs it for legacy sessions); everywhere else it warns. - Disable: `BILI_CONFLICT_SCAN=0`. diff --git a/CONFIGURATION.zh-CN.md b/CONFIGURATION.zh-CN.md index 9b5d47eda7..de13915da9 100644 --- a/CONFIGURATION.zh-CN.md +++ b/CONFIGURATION.zh-CN.md @@ -2032,6 +2032,68 @@ bili plugin remove pi # 撤销(原文件一次性备份为 *.bili-bak) - **发现结果的出口**:客户端启动前的 launcher stderr;每个会话首个请求的一次性代理 warn 日志(client 由 `x-bili-plugin` 头或 wire 头识别);会话冲突台账 —— `acp_status` 的 `COMPRESSION CONFLICTS` 段、`GET /__bili/stats` → `conflicts`、Web UI 横幅。 - **运行时证据**:未宣告的历史改写(#1001)与孤儿块废弃(被摘要的内容从客户端历史中被删掉)记入同一台账,让「疑似并存」与「实际观测到的干扰」互相印证。 - **dsh 的 `auto: false` 只关闭自动触发**。profile bundle patch(`dsh.bundle.patch.yml`)写入的 `compaction-basic: { auto: false }` 跳过压力/溢出自压缩 —— 手动 `/compact`(以及空闲会话压缩)仍会触发。经 bili 路由的调用会被服务端闸门拒绝(#1729/#2360);未经过 bili 直达上游的调用(桌面端插件接管门无法归因的路径)会落地,bili 在下次重放时检测出来(checkpoint 框架 + 折叠覆盖缺口),一个 turn 内重建自己的压缩状态,而不是让之后每次 compress 永久失败(#2432)。 + +#### 在 web profile 下关掉 dsh 原生自动压缩(#1772/#2474) + +随包发行的 `dsh.bundle.patch.yml` 做不到这件事:在 bundles 含 `@deepseek-ai/dsh-web-app` 的 profile 里,它的 `- id: compaction-basic` 行落在 web-app 的**宿主层行上,而那一行本来就是 `disabled: true`**;真正在运行的实例位于 `preset-standard.config.plugins` 内部。补丁静默生效、什么都没改。 + +**profile 层补丁可以关掉它** —— preset 是 bundle 层插入的普通顶层条目,而 profile 补丁层在其之后应用。不能用「按 id 定位嵌套行」的写法,可行的是**整体覆盖 preset 行的 `config`**。 + +**配方**(已在 dsh `0.2.1-alpha.1`、Windows 11、bundles 含 `@deepseek-ai/dsh-web-app` 的 profile 上实测): + +```bash +# 1. dump 组合后的 profile,复制 preset-standard 的完整 config 块 +dsh --profile --dump-config > /tmp/profile.yml +``` + +2. 往 `$DSH_HOME/profiles//cordis.patch.yml` 追加一条 `preset-standard`,`config` 用上一步 dump 出的**完整内容**(每一个 `plugins` 条目逐字节照抄),只改一处:在 `compaction` 组里的 `compaction-basic` 行下加 `config: { auto: false }`。 + +```yaml +- id: preset-standard + name: '@deepseek-ai/dsh-agent-preset' + config: + id: standard + order: 1 + plugins: + # … dump 出的全部条目,原样照抄 … + - id: compaction + name: cordis:group + group: true + isolate: + compaction: true + toolResultPruner: true + config: + - id: compaction-basic + name: '@deepseek-ai/dsh-compaction-basic' + config: + auto: false # ← 唯一改动 + - id: command-compact + name: '@deepseek-ai/dsh-command-compact' + - id: tool-result-pruner + name: '@deepseek-ai/dsh-compaction-tool-result-pruner' + config: + thresholdChars: 8192 + headChars: 4096 + tailChars: 1024 + # … 其余条目原样照抄 … +``` + +3. 用之前先核对:`dsh --profile --dump-config | grep -A2 'id: compaction-basic'` —— `preset-standard` 的条目数必须**不变**,且嵌套行现在带上了 `config.auto: false`。 + +压力/溢出自动压缩关掉,手动 `/compact` 与 tool-result pruner 保留。若会话会用到 `preset-ptc` / `preset-cordis`,按同样形状各做一份(`preset-minimal` 没有 `compaction` 组)。 + +**三种错法 —— 全都静默**(同一份 dump 上实测): + +| 补丁写法 | 结果 | +|---|---| +| `- id: preset-standard.compaction.compaction-basic` | `patch: entry "…" not found`;**无任何效果** | +| `- id: preset-standard` + 只写部分 `config.plugins` | `config` 是**替换而非合并** —— preset 塌缩成你写的那几项(实测 35 → 3):persona、工具全没了 | +| `- insert:` + `id: preset-standard` | 在树末尾**追加第二条** `preset-standard`;真正运行的 preset 未被修改 | +| 完整 `config` 快照 + 一处 `auto: false` | ✅ 条目数不变,唯一差异是 `auto: false` | + +**快照会冻结在你复制的那个 dsh 版本上。** 与 bundle 层补丁不同,profile 层的 `config` 是一份时点拷贝:dsh 升级后若增删或调整了内置 preset 里的行,这份覆盖仍会继续供应旧名单 —— 上游新加的插件不会静默加载。请重新执行第 1 步,把新的 `preset-standard` 段与补丁里的那份做 diff,只要该段有变化就整段重抄一次。若不想维护这份快照,那就保持原生自动压缩开启,让 #1729/#2432 的 rebase 路径去处理两者的相互作用。 + +部分覆盖失败时没有任何诊断信息,所以改完务必重新 dump 并比对条目数。 - opencode launcher/native 模式下已存在的 `opencode-acp` 按设计只记 info(#920 有意吸收它处理 legacy 会话);其他场景一律告警。 - 关闭方式:`BILI_CONFLICT_SCAN=0`。