Skip to content

docs(dsh): profile-layer patch recipe that actually disables native auto-compaction in web profiles (#1772/#2474) - #2476

Merged
ranxianglei merged 2 commits into
ranxianglei:masterfrom
iuuuuuuuu:2026-10-09_dsh-preset-auto-off-recipe
Oct 9, 2026
Merged

ranxianglei merged 2 commits into
ranxianglei:masterfrom
iuuuuuuuu:2026-10-09_dsh-preset-auto-off-recipe

Conversation

@iuuuuuuuu

@iuuuuuuuu iuuuuuuuu commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1772, #2474, #1786

What

Adds the working recipe for turning dsh native auto-compaction off in a web profile, to both CONFIGURATION.md and CONFIGURATION.zh-CN.md.

#1772 closed with "the running compaction-basic lives inside an agent preset that no patch layer can reach by id", and #1777's boot warning ends on "dsh native auto-compaction stays enabled in this profile". Both are correct about id-addressing — but the conclusion "no patch layer can reach it" is too strong: presets are ordinary top-level rows inserted by the bundle layer, and the profile patch layer is applied after it, so a profile patch can override the preset row's config wholesale.

Verified on dsh 0.2.1-alpha.1 (Windows 11, profile bundles including @deepseek-ai/dsh-web-app):

$ dsh --profile tauri --dump-config                      → preset-standard: 35 entries, compaction-basic without config
$ dsh --profile tauri --dump-config --patch ./recipe.yml → preset-standard: 35 entries (unchanged),
                                                           compaction-basic now carries config: { auto: false }
                                                           command-compact kept ✓  tool-result-pruner kept ✓  persona kept ✓

Automatic pressure/overflow compaction off; manual /compact and the tool-result pruner stay — which is exactly what #1772 wanted and believed impossible. No upstream dsh change, no user-root directory, no roster-default replacement.

The failure modes are all silent — documented as a table

Because config is replaced, not merged, the obvious "write only the part I want to change" patch destroys the preset without any diagnostic. Measured against the same dump:

Patch form Result
- id: preset-standard.compaction.compaction-basic patch: entry "…" not found; no effect
- id: preset-standard + partial config.plugins preset collapses to the written entries (35 → 3): no persona, no tools
- insert: with id: preset-standard appends a second preset-standard row; live preset untouched
full config snapshot + one auto: false ✅ entry count unchanged, only delta is auto: false

The doc section tells readers to re-dump and compare entry counts after editing, since a partial override fails silently.

Scope

Docs only — CONFIGURATION.md + CONFIGURATION.zh-CN.md, 120 insertions, 0 deletions, no version touch, no source changes. The new subsection sits under the existing "Detecting other compression plugins (#1206)" list, right after the auto: false bullet it extends.

Revision note (after review)

The snapshot-refresh caveat the review asked for landed in 4713d36 — the head under review was 58816e8, which predates it. Both files carry it now (**The snapshot is frozen at the dsh version you copied from.** / **快照会冻结在你复制的那个 dsh 版本上。**), placed after the three-failure-modes table, and the recipe offers the opt-out: keep native auto-compaction on and let the #1729/#2432 rebase path handle it instead.

CI on 4713d36: 24/24 success.

Notes for review

Part of #2474 — the issue stays open until the code-side PR (#2477, the boot warning's exit route) also lands; this PR covers only the docs half.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 收到,正在审核 PR #2476(docs-only:CONFIGURATION.md + CONFIGURATION.zh-CN.md)。会按规范走:原 issue 方向核查(#1772/#2474/#1786 的结论是否被新 recipe 推翻)、文档准确性(新增小节与现有 "Detecting other compression plugins (#1206)" 一节的衔接)、zh/en 同步、diff 整洁度。结论稍后按结构化八问给出。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 审完了:diff 逐行 + 文档里每个事实断言对照仓库核对 + CI 全绿(58816e8ec 上 20+ checks 全部 success,含 docs-sync/docs-coverage)。

验证过程

八问

  1. 是什么问题:dsh.bundle.patch.yml 禁用自动压缩在 web profile 下静默失效 #1772/fix(dsh): warn at boot when web presets keep native auto-compaction (#1772) #1777 得出「preset 内 compaction-basic 任何 patch 层都够不到」——结论过强。preset 是 bundle 层插入的普通顶层行,profile patch 层在其后应用,可以整行覆盖 preset 行的 config。本 PR 把可用的配方写进文档。
  2. 什么原因:dsh patch 引擎只索引顶层行与真 group 子项(点号嵌套 id 找不到),且 config 是替换不是合并;dsh.bundle.patch.yml 禁用自动压缩在 web profile 下静默失效 #1772 当时只试了 id-addressing、没试整行替换,才得出「不可达」。
  3. 影响范围与严重程度:web profile(bundle 含 @deepseek-ai/dsh-web-app)此前没有任何办法关掉原生自动压缩——纯功能缺口,无数据丢失/安全影响。修好后即 dsh.bundle.patch.yml 禁用自动压缩在 web profile 下静默失效 #1772 想要的效果:压力/溢出自动压缩关,手动 /compact 与 tool-result pruner 保留。
  4. 怎么修复的:纯文档——三步配方(dump 快照 → 整行替换 + auto:false → 再 dump 核对条目数不变)+ 三种静默失败形态表(partial config 掏空 35→3 且 exit 0;点号 id entry not found;insert: 追加重复行不动原行)。
  5. 回归问题:无——纯增量文档,零代码/config schema/wire/persistence/阈值/时序改动;zh/en 同步。
  6. 缓存:不涉及(无运行时变化)。
  7. 设计方向:不变——刻意不走 docs(dsh): user-preset recipe disables native auto-compaction in web profiles (#1772) #1786 方案(依赖 includeUserRoot/.agent-presets/plural package,均已在 0.2.1-alpha.1 上确认不存在),也不走 feat(dsh): ship in-package bili preset as the roster default (#1772) [discussion draft] #1827(owner 已拒为过于侵入)。
  8. 新配置:无——教的是 dsh 既有 --patch 机制,无新增 BILI_* key 或默认值。

合并前一个小补:缺「快照刷新时机」。整行替换会冻结你抄下来的 roster——dsh 升级后上游往 preset-standard 新加的插件到不了这个 profile,直到重新 dump、对比、重抄。这是与本表同级的第四种静默失效(#2474 也约定了这句要进文档)。措辞已备好,插在「Repeat the same shape…」段与「Three ways to get this wrong」之间:

EN:

Keeping it current: the snapshot freezes the roster you copied — after a dsh upgrade, diff the new --dump-config's preset-standard section against your patch and re-copy the whole block, otherwise plugins the upstream added to the preset never reach this profile.

ZH:

**保持快照新鲜:**快照冻结的是你抄下来的那份 roster——dsh 升级后,拿新 --dump-config 里的 preset-standard 段与你的补丁对比、整段重抄一次,否则上游往 preset 里新加的插件到不了这个 profile。

(我本地已提交为 12a2daf00,但你的 fork 对我是私有仓库推不上去——请自行加上,或给我分支权限。)

非阻塞提示

判定:补上快照刷新一句即可合入;其余全部通过(diff 干净、位置正确、zh/en 对齐、事实断言全核过、CI 绿)。

@iuuuuuuuu

Copy link
Copy Markdown
Contributor Author

收到审阅,两点都已处理:

1. 快照刷新那句 —— 已在 4713d36 落地

你审的是 58816e8,那句是在它之后补的 commit。现在两个文件都带(位置按你的建议,放在三种失败形态表之后):

EN — **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.

ZH 同步镜像。措辞与你的备选稿同义,额外给了「不想维护快照就别关原生压缩」的退出选项 —— 因为快照冻结本身是这个方案的真实代价,不给出口的话文档只说了半个故事。

4713d36 上 CI 24/24 全绿。

2. Closes → Part of

你说得对:#2474 还挂着代码侧那个动作(启动告警指路),本 PR 只承接文档半边,合并不该连带关掉 issue。PR 正文已改为:

Part of #2474 — the issue stays open until the code-side PR (#2477, the boot warning's exit route) also lands; this PR covers only the docs half.

3. 关于 #2477

看过了,+61 -27 / 9 files,告警指路 + 两个坑位(含我补的「部分 config 会连 id/order 身份一起丢」)+ insert: 追加死行。与 #2476 无文件重叠(CONFIGURATION.md/zh 归我,你碰的是 launcher/dsh-native/config/CLIENTS/README),不会撞车。README 两行你收走了,我这边就不动。

两个 PR 都合即可关 issue;合并按规矩留给你。

补充一句供你收尾参考:我这份 docs 里写的是「重复同样形状给 preset-ptc / preset-cordis」——如果 #2477 的告警文案只提 preset-standard,用 PTC/创建者模式的用户会以为不适用,建议文案里点一句。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 两点都核实过了,收尾:

  1. 快照刷新句 ✓ — 4713d36 上确认(parent 恰为 58816e8ec,单 commit、两文件各 +2/-0,无夹带)。位置在三种失败形态表之后,zh/en 镜像;措辞覆盖冻结语义 + 刷新步骤,还多了退出选项。退出选项我单独验过不是空话:nudge 死锁无检测:同一 session 交替收到两种结构互斥的请求流(巨型单消息 ↔ 多轮)时不告警 #1729/[bug] DSH 桌面端 0.1.188:宿主原生压缩落地摧毁折叠基底 → 同一区间永久不可锚定、compress 连片失败并熔断(compaction-basic auto:false 仍无效) #2432 真实存在且已关闭,其「rebase 路径」在 master 上有实体(f48424c41 dsh 原生压缩未经 bili 落地时 rebase ACP state、db585effe responses lane 同修)——建议成立。
  2. Closes → Part of ✓ — 正文尾部现为 "Part of fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474 … stays open until the code-side PR (fix(dsh): #1772 结论修正 —— web profile 可用 profile 层完整快照 patch 关掉原生自动压缩(告警指路 + 坑位警示) #2477…) also lands";fix(dsh): #1772 结论修正 —— web profile 可用 profile 层完整快照 patch 关掉原生自动压缩(告警指路 + 坑位警示) #2477 存在(open:告警指路 + 坑位警示 + 测试钉住指针),文件集与我贴进 fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474 的清单一致且含 README 两行,与本 PR 零重叠。

八问增量(①–④ 与上轮不变):⑤ 回归仍无——纯增量文档,零运行时变化;⑥ 缓存不涉及;⑦ 设计方向不变;⑧ 无新配置。新增内容仅一段维护指引,事实核查通过。CI 在 4713d36 上 24/24 全绿 ✓。

你补的 #2477 提示(告警只提 preset-standard 会让 PTC/创建者模式用户以为不适用)——已转发到 #2477 线程并附建议措辞;顺带提醒了 #2477 注释「indexes top-level rows only」与旧 CLIENTS.md「top-level rows and true group children」的措辞需对齐(该 PR 正在重写那节)。

判定:本 PR 可合(合并照旧留给人)。#2477 落地后 #2474 即可关闭。

@ranxianglei
ranxianglei merged commit 80e71a7 into ranxianglei:master Oct 9, 2026
24 checks passed
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.189-master.80e71a7 (rolling master tag).

npm install -g billion-context@0.0.189-master.80e71a7  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

thlinhit pushed a commit to thlinhit/billion-context that referenced this pull request Oct 9, 2026
…-snapshot patch CAN switch off web-profile native auto-compaction (ranxianglei#2474)

The ranxianglei#1772 boot warning ended in a dead end ('no patch layer can reach'). Verified live against dsh 0.2.1-alpha.1: preset-standard is an ordinary bundle-layer entry; a profile-level cordis.patch.yml row (applied after every bundle) replaces its config WHOLESALE, so a full-snapshot override carrying auto:false under compaction-basic switches off native auto-compaction. The once-per-process warning now names that recipe plus both verified traps (a partial snippet drops everything not restated — other plugins AND the preset's id/order identity; - insert: with the same id appends a dead duplicate row); launcher stderr, config doc, bundle-patch header and CLIENTS(en/zh)/README(en/zh) corrected to match; the regression test pins the exit pointer. Snapshot-freeze walkthrough lives in the companion CONFIGURATION.md PR (ranxianglei#2476). Supersedes ranxianglei#1786's dead recipe (.agent-presets user root removed in dsh 0.1.7+).

Refs ranxianglei#2474
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants