Skip to content

[PR] feat(dsh): keepCommandCompact — opt-in overlay scope keeping the explicit /compact command under bili (#4872) - #4883

Open
ranxianglei wants to merge 12 commits into
masterfrom
2026-10-27_dsh-keep-command-compact
Open

ranxianglei wants to merge 12 commits into
masterfrom
2026-10-27_dsh-keep-command-compact

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #4872

What

The #3354 load-time overlay (bili-compaction-gate) marks BOTH @deepseek-ai/dsh-compaction-basic AND @deepseek-ai/dsh-command-compact disabled: true in dsh web-profile presets. compaction-basic is the right target (its auto-compression checkpoints shadowed the fold substrate, #1729), but command-compact carries the EXPLICIT /compact command — the DSH-official bridge third-party plugins borrow via ctx.commands.find(agent, "compact") (e.g. dsh-switchman's /ctx-handover). Disabling it made those plugins degrade to undefined with nothing pointing at bili.

Owner decision (#4872 floor): ship an opt-in switch this release; full unbinding of the auto-compaction constraints waits for server-side compaction to fully take over next phase (see Follow-up below).

config surface

New keys (both default OFF = today's behavior):

key kind default effect when on
dsh.keepCommandCompact file (billion-context.json) false overlay disables only compaction-basic; command-compact rows pass through untouched
BILI_DSH_KEEP_COMMAND_COMPACT env-only false same; env wins over file

Why the existing surface could not express this: the overlay scope was a hardcoded two-package constant list (src/agent/dsh-compaction-disable.ts, rule at :159-161) with no knob to narrow it. Alternatives considered: reusing dsh.authoredCompaction — rejected, that knob controls whether bili ANSWERS dsh compaction calls locally (#3733), not which rows get disabled; conflating them would let local-answering users still break /compact-dependent plugins. Per-package booleans — rejected as overkill; the real design axis is one flag: "auto vs explicit".

Owner sign-off pre-implementation (#4872 floor): 「ework 可以给出配置开关 允许本issue发生,本期这样」.

Behavior change disclosure

Follow-up direction (recorded, NOT implemented here)

Per the owner decision, the next phase (等服务端压缩彻底转正) removes the auto-compaction constraints entirely, on the principle that the compression plugin depends only on incremental messages and can ignore stock history. That is separate work; this PR ships only the opt-in switch.

Tests

  • New tests/issue4872-dsh-keep-command-compact.test.ts: pure-function scope (default pins both-disabled; keep=true passes compact rows through BY IDENTITY at top/group/deep nesting depths, input untouched), verdict channel (flag rides the declaration; legacy "active" string tolerated), transform e2e (telemetry count locked to the rewrite; compact-only tree returns the input object untouched), knob tiers (env > file > default via BILI_CONFIG_FILE).
  • Local targeted runs green: issue4872 + issue3354 + issue3662 + issue4147 + config-surface-guard batch (30/30), dsh-native (68/68, extended with declaration-flag assertions incl. kill-switch still silent), dsh-settings-ui (25/25). npm run typecheck clean. Full suite = CI.

ci-check added 2 commits October 27, 2026 01:15
…li (#4872)

The #3354 load-time overlay disabled BOTH dsh compaction packages in
web-profile presets. compaction-basic is bili's target (auto-compression
whose on-disk checkpoints shadowed the fold substrate, #1729), but
command-compact carries the EXPLICIT /compact command — the DSH-official
bridge third-party plugins borrow via ctx.commands.find(agent, "compact")
(e.g. dsh-switchman's /ctx-handover). Disabling it made those plugins
degrade to undefined with nothing pointing at bili.

Owner decision (#4872 floor): ship an opt-in switch this release; full
unbinding of auto-compaction constraints waits for server-side compaction
to fully take over next phase.

- new knob dsh.keepCommandCompact (file) / BILI_DSH_KEEP_COMMAND_COMPACT
  (env), default OFF = today's behavior, zero drift; resolved once at
  bili-native activation, takes effect at the next host restart
- verdict channel now carries {active, keepCommandCompact} (legacy
  "active" string tolerated for mixed-version mid-update windows);
  disableBasicCompaction/countCompactionRows take the scope flag so the
  rewrite and its telemetry count stay in lockstep
- web settings UI row + boot-note wording follow the flag
…#4872)

Config-surface seeds (website/config-reference/{server,env-only}.yaml),
generated CONFIGURATION.md tables (en/zh via gen-config-docs), manual
long-form env rows, and CLIENTS.md/.zh-CN.md web-profile paragraphs:
the overlay's /compact re-enable is now scoped to the explicit command —
auto-compaction still has no re-enable switch by design (#3651/#3666);
/compact-triggered calls remain gated by the #1729 wire guard.
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-27_dsh-keep-command-compact (d61d472)

Latest build — install this exact version

npm install -g billion-context@0.0.9298-pr.4883.a70a0c9

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

Recent builds (commit → version)

commit version build
d61d472 billion-context@0.0.9298-pr.4883.a70a0c9 build
2470631 billion-context@0.0.7349-pr.4883.6203999 build
d15ab28 billion-context@0.0.7057-pr.4883.d166a00 build
76c45cd billion-context@0.0.6842-pr.4883.cd68f90 build
6f0ba1a billion-context@0.0.6346-pr.4883.bcd5e9c build
995d1ed billion-context@0.0.6342-pr.4883.c43888d build
337a658 billion-context@0.0.6332-pr.4883.0bcd39e build
25eaa12 billion-context@0.0.6330-pr.4883.e633b46 build
77c60b0 billion-context@0.0.6325-pr.4883.f6dd118 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title feat(dsh): keepCommandCompact — opt-in overlay scope keeping the explicit /compact command under bili (#4872) [PR] feat(dsh): keepCommandCompact — opt-in overlay scope keeping the explicit /compact command under bili (#4872) Oct 26, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)
Merged origin/master into the branch (clean, no conflicts; 77c60b0 → 25eaa12), local typecheck passes — PR is now in sync with master, mergeable_state blocked only while CI runs on the new head.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复。 这是 #4872 的唯一实现 PR(Closes #4872;检索引用 4872 的 PR 只有本条),dsh-compaction-disable / keepCommandCompact 主题无并行工作项。本条是既有 agent 工作的 [PR] 镜像,按「识别自己的 PR」规则处理:核对分支与 CI、做完整 review,不重做。

标签: dsh、scope/wiring、p3 —— 功能交付(opt-in 开关,默认 OFF 零漂移),非缺陷不打 bug;底层插件失效问题在 #4872 侧已按 p2 管理。

状态(初核完成):

…LE.md ledger (#4872)

The lifecycle-ledger-guard CI job requires every BILI_* env var read from
src/ to be registered in LIFECYCLE.md. The keepCommandCompact switch added
by this PR was missing from the ledger, so the guard failed on the PR head.
Added it under §1 (transition switches): it is an opt-in scope narrowing of
the #3354 load-time overlay, and retires with the next-phase decision to
unbind auto-compaction entirely (#4872).
@ranxianglei ranxianglei added the p2 label Oct 26, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Merge-guard sync done: merged origin/master into the branch cleanly (no conflicts; 77c60b0 → 25eaa12), local typecheck passes, pushed to 2026-10-27_dsh-keep-command-compact. Verified via API: head=25eaa12e8, mergeable_state=blocked — i.e. in sync with master, only CI checks pending on the new head. No design decisions required.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI 确认:新头 337a65835(含 LIFECYCLE.md 台账登记修复)全部 check 绿(rollup SUCCESS,含 lifecycle-ledger-guard 与 ubuntu/windows × node22/24 全部分片)。无阻塞项,可以合并:#4883

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Resynced again (master moved twice in between): merged current master cleanly into the branch, no conflicts, local typecheck passes — pushed 337a658 → 995d1ed → 6f0ba1a. Verified via API: head=6f0ba1a32, 0 commits behind master, mergeable_state=blocked = in sync, only CI checks pending on the new head. No design decisions required.

Merge master (33104b1) into 2026-10-27_dsh-keep-command-compact to
clear the upstream merge_conflict blocker for PR #4883.

Conflicts (8 in 6 files) — all doc-layout reorg (#5920) + one code file:
- src/agent/dsh-native.ts (2): kept master's #5686 boot-note latch
  structure verbatim; injected the PR's keepCommandCompact text into the
  web-app branch and the non-web trace branch (docs/configuration.md path).
- CONFIGURATION.md / .zh-CN.md: root = master's redirect stub; ported the
  PR's 5 keepCommandCompact entries into docs/configuration(.zh-CN).md.
- CLIENTS.md / .zh-CN.md: root = master's stub; ported the PR's
  keepCommandCompact dsh-section edits into docs/clients(.zh-CN).md.
- LIFECYCLE.md: root = master's stub; ported the PR's
  BILI_DSH_KEEP_COMMAND_COMPACT ledger row into docs/lifecycle.md.

Verified: npm run typecheck clean; node --import tsx --test
tests/dsh-native.test.ts = 76/76 pass.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

七问 — PR #4883 conflict-resolution run (attempt 1/3)

  1. What was the blocker? The PR branch 2026-10-27_dsh-keep-command-compact was 1766 commits behind master (upstream merge state dirty/behind) — the merge_conflict blocker.

  2. What did I do? Merged origin/master (33104b1) into the PR branch — a merge, not a rebase, matching the established merge-guard pattern of the prior merge commits already on this branch.

  3. What conflicts, and how resolved? 8 conflicts in 6 files. All were the [PR] docs: batch-migrate 14 root-level documents into docs/ (consolidation + master index + redirect placeholders) | docs: 14 个根级文档一次性迁入 docs/(集中 + 总目录 + 重定向占位) #5920 doc-reorg (root docs → docs/ + redirect stubs) plus one code file:

  4. What did I verify? npm run typecheck clean (kernel + pi-subagents built, tsc --noEmit no errors); node --import tsx --test tests/dsh-native.test.ts = 76/76 pass. (Full-suite verdict is the remote CI on the pushed head, per §7.2 — not a local full run.)

  5. Did I push? Force or clean? Clean fast-forward push — the remote head (2470631) was an ancestor of my merge commit, so no force-push was needed. Fetched + checked the remote head immediately before pushing, per push discipline.

  6. Current state? Branch is now 0 behind / 12 ahead of master — the merge_conflict blocker is cleared. The mirror check cache is still stale (fetched_at 2026-10-31, sha 2470631 = the pre-merge head); the new CI run on d61d472 is pending and not yet visible in the cache, so I cannot assert its green/red live in this run.

  7. What remains / risk? Only the remote CI on the new head remains (re-runs automatically). Risk is low: the conflict was doc-layout reorg + one code file where I kept master's structure verbatim and only re-injected the PR's existing keepCommandCompact text — no new behavior, no config-surface change, no kernel/ touch. If CI is red, I'll triage it in this same lane (attempt 2/3).


八问(中文,供人工评审):

  1. 是什么问题:PR [PR] feat(dsh): keepCommandCompact — opt-in overlay scope keeping the explicit /compact command under bili (#4872) #4883 分支落后 master 1766 个提交,上游报 merge_conflict(dirty),无法合并。
  2. 什么原因导致:分支自 2026-10-27 起未同步 master,期间 master 完成 [PR] docs: batch-migrate 14 root-level documents into docs/ (consolidation + master index + redirect placeholders) | docs: 14 个根级文档一次性迁入 docs/(集中 + 总目录 + 重定向占位) #5920 文档集中化(根级文档迁 docs/ + 重定向占位)及大量其他提交,与本 PR 触碰的 6 个文件产生文本冲突。
  3. 影响范围与严重程度:仅本 PR 分支的合并状态,不影响任何已发布行为;默认 OFF 的 keepCommandCompact 零漂移,默认路径字节不变。
  4. 怎么修复的:merge origin/master 进分支(非 rebase,沿用本分支既有 merge-guard 模式);8 处冲突全部按「保留 master 结构 + 重新注入 PR 的 keepCommandCompact 文本」解决,文档按 [PR] docs: batch-migrate 14 root-level documents into docs/ (consolidation + master index + redirect placeholders) | docs: 14 个根级文档一次性迁入 docs/(集中 + 总目录 + 重定向占位) #5920 布局落进 docs/ 而非根级。
  5. 是否有回归问题:无。dsh-native.ts 两处冲突均逐字保留 master dsh Long-Session Drift Comprehensive Remediation: Sealing the Last Leak Window for Native Compression Local Deployment + | dsh 长会话漂移综合治理:堵死原生压缩本地落地的最后漏窗 + 会话身份分叉可见化与自愈 #5686 结构、仅插入 PR 既有文本;其余 5 个文件是文档占位/迁移,无行为语义。typecheck 干净、dsh-native 定向测试 76/76 绿。
  6. 是否破坏缓存:不涉及——未触碰缓存/重试/游标/去重键任何路径。
  7. 是否改了设计方向:不涉及——纯冲突消解,未改架构/边界/数据流。
  8. 是否引入了新的配置:不涉及——keepCommandCompact 配置面是 PR 本身已声明的(非本次冲突消解新增),本次仅把它落进 reorg 后的 docs/ 位置。

判定:冲突已清(0 behind master),merge 已推(d61d472,干净 push 无 force),等远程 CI 在新 head 上重跑;CI 红则本车道 attempt 2/3 继续。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

Status (re-trigger, live-verified this run): This is a re-fire of the already-resolved conflict — no new work done, nothing re-pushed.

Live state as of this run (fresh git fetch + mirror cache):

  • Conflict resolved: branch 2026-10-27_dsh-keep-command-compact is 0 behind / 12 ahead of master; master tip (33104b1) is an ancestor of HEAD. The mirror's mergeable_state reads behind (NOT dirty) — GitHub's async mergeability computation is just lagging the push; the authoritative git check confirms no conflict.
  • CI running on the new head (d61d472, mirror fetched 08:38:23Z): 5 success / 13 skipped / 12 in progress / 0 failures. The 13 skips are the gated e2e/codex lanes (no gate env in this run) — normal.
  • Remote head = d61d472 = my merge commit; no other agent moved the branch.

No further action this run. If CI lands red, this lane re-triggers (attempt 2/3) and I'll triage the failure; if green, the PR is mergeable for the owner. The full 七问 of the conflict-resolution work is in my previous comment.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant