Skip to content

[PR] fix(dsh): stand the host-plane /compact command down on a bili-owned lane (#7154) - #7159

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
resec:2026-11-18_dsh-command-compact-disabled
Nov 24, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
resec:2026-11-18_dsh-command-compact-disabled

Conversation

@resec

@resec resec commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #7154.

问题

非 web 的 dsh profile 里,/compact 在命令表里,但每一次执行都被 bili 的 #1729 守卫拒绝,而 dsh 把拒绝报成"模型没摘要"。

真机读数(dsh --profile <p> --dump-config,bili 已以 bundle 方式挂入):

- id: compaction-basic
  name: '@deepseek-ai/dsh-compaction-basic'
  config:
    auto: false            # ← bili 的 bundle patch
- id: command-compact       # ← base bundle 带进来,bili 没覆盖
  name: '@deepseek-ai/dsh-command-compact'

链路:/compact → ctx.compaction.compactNow() → 用 COMPACTION_INSTRUCTION 模板发一次总结请求;这条请求与自动压缩是同一个信封(src/server/dsh-compaction-guard.ts 的注释原文:auto pressure, context-overflow recovery, and manual /compact all send the same envelope),因此被无条件 422 拒绝(该守卫也不以插件标记为开关)。拒绝后按 ManualCompactionError('summary') 映射成:

Compaction could not produce a useful summary. The attempt is recorded in the session log.

用户看到的是"模型不行",重试恒失败。

怎么修的

在两个 patch 载体里把这条命令关掉——它们是车道被挂载的仅有的两条路,必须同步(同 #3354 的既有纪律):

  • dsh.bundle.patch.yml(持久安装):- id: command-compact + disabled: true;
  • src/launcher.ts 的 writeDshAcpPatch()(bili dsh overlay):同一行。

语义与紧邻的 compaction-basic: auto: false 完全一致(静态:bili-native 被 kill-switch 也不会把它带回来)。逃生口写在行内注释里:用户在自己 profile 的 cordis.patch.yml 里给同一 id 写 disabled: false 就能把它拿回来——代价是每次调用仍在 wire 上被拒。

验证

真机合成:把改后的 dsh.bundle.patch.yml 当 patch 层应用到真实 dsh profile,--dump-config 结果:

- id: compaction-basic
  name: '@deepseek-ai/dsh-compaction-basic'
  config:
    auto: false
- id: command-compact
  name: '@deepseek-ai/dsh-command-compact'
  disabled: true

新增测试(tests/issue7154-command-compact-disabled.test.ts,2 条):

  1. bundle 层必须带 disabled: true 行,且该行是顶层 patch 行、不在 insert 列表里(insert 会多挂一条,宿主原来那条仍然活着);同时 auto: false 行必须保留;
  2. launcher overlay 必须带同一行、且顺序在 auto: false 之后(读起来是同一个决定),同样不得以 insert 形式出现。

负向对照:把 dsh.bundle.patch.yml 里的两行删掉 → 第 1 条立刻红;恢复后 2/2 绿。

本地:typecheck 干净;issue2605 / issue3354 / issue3662 / issue7154 四套 18 条全过(这三套都直接读 dsh.bundle.patch.yml,改 yml 必须过它们)。

风险 / 边界

  • 不是模型可见文案变更(改的是命令是否注册,不是注入文本)。
  • 已知取舍:bili-native 被 disable 时 /compact 也不会回来——与同文件 auto: false 同层静态语义,不是新引入的不一致;要恢复用上面那个 disabled: false 逃生口。
  • 文档未改:en / zh-CN / ja 三份的 /compact 段落同步应单独一轮(本 PR 的行为说明落在 yml 行内注释里)。若你希望这个 PR 就把文档带上,我按 docs-sync 的规则补齐后再推。
  • web profile 不受影响:那里真正运行的 command-compact 在 preset 的嵌套行里,已由 #3354 的加载期 overlay 处理;这条顶层行在 web 上本来就没人用。

…lane (ranxianglei#7154)

/compact drives the host's own compaction call — the same envelope bili's wire
guard refuses unconditionally (ranxianglei#1729) — so on a bili-owned lane the command has
no outcome except failure. dsh reports that failure as "Compaction could not
produce a useful summary", blaming the model for a policy refusal, and every
retry fails identically because the refusal is terminal.

Disable the command entry in both patch carriers (persistent bundle + launcher
overlay) with the same static semantics as the adjacent compaction-basic
auto:false row. Escape hatch: a profile-level `disabled: false` for the same
id brings it back; invocations are still refused at the wire.
@ranxianglei ranxianglei changed the title fix(dsh): stand the host-plane /compact command down on a bili-owned lane (#7154) [PR] fix(dsh): stand the host-plane /compact command down on a bili-owned lane (#7154) Nov 18, 2026
@ranxianglei
ranxianglei merged commit 444165b into ranxianglei:master Nov 24, 2026
48 checks passed
ranxianglei pushed a commit to mariopasquali/billion-context that referenced this pull request Nov 25, 2026
…ranxianglei#7678 wal-reclaim-passive (walJournalSizeLimitBytes default 0, ranxianglei#7674) + ranxianglei#7617 identity-tables-consolidate + ranxianglei#7581 egress block-flow checkpoint retire + ranxianglei#7659 eg-GA docs wrapup + ranxianglei#7671 degenerate-retry + ranxianglei#7676 megaturn-bridge + ranxianglei#7677 doom-prompt-mass + ranxianglei#7632 pure-echo latch + dsh batch (ranxianglei#7161/ranxianglei#7159/ranxianglei#7158/ranxianglei#7129/ranxianglei#7127)

Only manual conflict: docs/configuration{,.zh-CN}.md env table — union of intent,
original line order: master's walJournalSizeLimitBytes row (default 0, ranxianglei#7674)
+ PR's archiveAfterDays row (with the bili storage migrate ranxianglei#5599 clause).
All code (src/persist.ts, src/storage/shadow.ts, src/storage/store.ts,
tests/storage-unified.test.ts) auto-merged; local typecheck clean and the
targeted storage suites (storage-unified/-ccr/-state-fields/
-batched-verification) pass 38/38 on the merged tree.

(ranxianglei#6773)
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.

[Bug][dsh] non-web profiles still mount /compact, but every attempt is refused by the #1729 guard — and the error blames the model

2 participants