Skip to content

fix(dsh): warn at boot when web presets keep native auto-compaction (#1772) - #1777

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-30_dsh-web-profile-compaction-warning
Sep 30, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-30_dsh-web-profile-compaction-warning

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What & why

#1772: in profiles whose bundles include @deepseek-ai/dsh-web-app, the bundled dsh.bundle.patch.yml entry - id: compaction-basic / config: {auto: false} silently targets the WRONG row — web-app's own host-plane compaction-basic row, which web-app already disables (disabled: true). The instance that actually runs lives inside an agent preset (preset-standard.config.plugins → compaction group) and is unreachable from any patch layer, so dsh's native auto-compaction keeps firing despite the README's "dsh auto-compaction off" claim. The patch executes successfully against the dead row: no error, no warning.

Root cause (verified against dsh 0.2.0-rc.2 sources)

@deepseek-ai/dsh-app-boot's applyEntryPatches indexes patch targets with a single pass over top-level rows plus children of TRUE YAML groups (group: true with array config). A preset row's config.plugins is plain config data, not a loader group, so its nested rows are never indexed — no patch layer can address them. dsh-compaction-basic's auto is config-only (no env seam). Repro dump (dsh --profile web --dump-config, bundles [dsh-base, dsh-web-app, billion-context]): the top-level row shows disabled: true / config: {auto: false} labeled "patched by @deepseek-ai/dsh-web-app, billion-context"; all three presets' nested compaction-basic rows carry no config → auto defaults to true.

No pure-YAML fix exists in this repo: patch config is whole-replacement, so targeting preset-standard would mean duplicating the entire upstream preset tree into our patch file (freezing upstream changes). Suppressing the running instance from the plugin side would require per-session mount observation inside dsh internals — out of proportion.

Changes

  1. Boot warning (src/agent/dsh-native.ts): once per process, the plugin reads the boot-provided profileContext.startedBundles (dynamic inject, best-effort like the [native] runtime-info protocol: plugins report real model config (model / contextWindow / maxOutput) to the proxy #955 llm services; missing service on older builds degrades to no diagnostic) and, when the profile bundles @deepseek-ai/dsh-web-app, logs a one-time [dsh-client] line through the durable channel (persistClientEvent → bili.log; GUI hosts swallow stderr) stating that dsh native auto-compaction stays enabled in this profile and that ACP compression is unaffected. Silent failure becomes a visible, greppable diagnostic.
  2. Docs scoped (README.md / README.zh-CN.md launcher lines, CLIENTS.md / CLIENTS.zh-CN.md dsh section): the "dsh auto-compaction off" claim now reads "off outside web profiles (dsh.bundle.patch.yml 禁用自动压缩在 web profile 下静默失效 #1772)", with the mechanism explained in CLIENTS.
  3. Test (tests/dsh-native.test.ts): warns exactly once for a web bundle set, stays silent for non-web sets, honors the once-per-process flag across re-applies, and covers the no-inject direct-field ctx shape.

Behavior change (flagged per house rules)

NEW additive log line: profiles bundling @deepseek-ai/dsh-web-app get ONE extra [warn] [v=…] [dsh-client] profile bundles include @deepseek-ai/dsh-web-app … line in the bili state-dir log at boot. No change to wire format, config schema, persistence, or compression behavior; non-web profiles produce nothing new.

Not fixed here (upstream)

The functional gap — making it POSSIBLE to disable the preset-nested compaction-basic — belongs to dsh (deepseek-ai/deepseek-harness): the patch language needs preset-scoped addressing (or preset mounts should inherit same-id host-row config, or web-app should propagate its host-plane compaction config into the presets). Filing there awaits owner approval per cross-repo policy; repro materials are ready in the working session.

Addresses #1772 (not auto-closed: the underlying behavioral fix lands upstream).

Pre-flight on rebased head (80b50b7): typecheck clean, 3400 tests / 0 fail (19 gated e2e skips), build OK.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-30_dsh-web-profile-compaction-warning (2bbde11)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.1755-pr.1777.09fbfcc

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr1777.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei force-pushed the 2026-09-30_dsh-web-profile-compaction-warning branch from 16ffafe to 3f96dd6 Compare September 30, 2026 14:32
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #1777 reviewed (against original issue #1772). Verdict: mergeable once CI is green on the rebased head (merge stays human-only). Details:

① Original-issue direction (highest weight) — sound. The #1772 root cause was reproduced against dsh 0.2.0-rc.2 sources with a --dump-config dump: the patch engine indexes only top-level rows + true-group children, so preset-nested compaction-basic is unreachable from any patch layer, and patch config is whole-replacement (targeting preset-standard would freeze the upstream preset tree). This PR fixes exactly the fixable part — the silent failure (boot-time visible diagnostic) plus the doc overclaim — without masking anything in transit and without claiming the functional off-switch, which correctly stays upstream (filing awaits your repo-address + approval, per cross-repo policy — still pending from floor 4 of #1772).

② Regression review — existing behaviors on touched paths, itemized:

③ Code — follows house conventions: durable channel via persistClientEvent (GUI hosts swallow stderr), no console.error, no as any/@ts-ignore, precise types. The once-per-process flag is set only when the warning actually fires, so a first apply() on an older build without the profileContext service cannot lock out the diagnostic — later applies retry. One minor observation (not blocking): sibling diagnostics (#1158/#1290) emit console.error and persistClientEvent, so on non-GUI dsh TUI hosts this caveat lands in bili.log only, not stderr. That's defensible minimalism for a boot-time informational line (it's greppable where all bili diagnostics live), but say the word if you want the stderr copy too.

④ Test quality — real teeth: asserts against the actual bili.log file contents (line count + content incl. the #1772 marker) across four shapes: web bundle set warns exactly once, second apply() adds nothing, non-web set is silent, and the no-inject direct-field ctx shape. A dropped/duplicated/misrouted warning would fail it. Not tested: inject-present-but-callback-never-fires (older build) — trivially bundles === undefined, acceptable gap.

⑤ Diff cleanliness — 6 files, single commit, every line on-purpose. Clean.

Stale-base fix (done by me): the branch was based on 80b50b7a; master has since advanced to 30a23cb1 (only #1773, an unrelated e2e test file — zero overlap with this PR's files). I rebased and force-pushed: new head 3f96dd6d. Pre-flight on the rebased head: typecheck clean, 3402 tests / 0 fail (19 gated e2e skips), build OK, new test passes in isolation (39/39 in tests/dsh-native.test.ts).

CI: old head 16ffafe3 ran 13/13 green. The rebased head's run is in progress (6/13 complete, all success so far) — I'll confirm when it finishes.

Duplicate screening: no other open issue/PR covers this (searched open PRs for dsh compaction; only this one addresses #1772). Note: #1774 is still 404, consistent with what floor 4 of #1772 reported — if that deletion wasn't deliberate, you may want to look into account/platform access.

Behavior change (as disclosed): one additive [warn] [v=…] [dsh-client] … line in the state-dir log at boot, web-profile bundles only. Accurate and complete disclosure; nothing else changes.

一句话中文摘要:审核了 PR#1777(#1772「web profile 下禁用 dsh 自动压缩的 patch 静默失效」)——方向正确(根因在上游 dsh patch 引擎够不到 preset 内实例,本 PR 把静默失效变成启动时可见告警并纠正文档过度宣称,功能级关闭留待上游)、wire/config/持久化/压缩行为零回归、测试直接断言日志文件内容有牙、diff 干净;我已把分支 rebase 到最新 master(3f96dd6d)并本地验证 typecheck + 3402 测试 + build 全绿,等 CI 转绿即可合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 CI confirmed green on the rebased head 3f96dd6d: 13/13 checks success (test matrix ubuntu/windows × node 22/24, e2e, real-client lanes dsh/pi/codex/opencode, hermetic registry e2e, build-artifact, version-guard). Nothing else outstanding on my side — the PR is ready for you to merge whenever (per house rules that stays with you): #1777

一句话中文摘要:rebase 后的新 head(3f96dd6d)CI 已全部转绿(13/13),PR#1777 可以合并;等你操作。

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.

1 participant