Repository navigation
[PR] feat(dsh): keepCommandCompact — opt-in overlay scope keeping the explicit /compact command under bili (#4872) - #4883
ranxianglei wants to merge 12 commits into
Conversation
…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.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9298-pr.4883.a70a0c9This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4883.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 这是 #4872 的唯一实现 PR( 标签: 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).
[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 |
[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= |
…ewest master (#4883 inherited-red resync)
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.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 七问 — PR #4883 conflict-resolution run (attempt 1/3)
八问(中文,供人工评审):
判定:冲突已清(0 behind master),merge 已推(d61d472,干净 push 无 force),等远程 CI 在新 head 上重跑;CI 红则本车道 attempt 2/3 继续。 |
[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
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. |
Closes #4872
What
The #3354 load-time overlay (
bili-compaction-gate) marks BOTH@deepseek-ai/dsh-compaction-basicAND@deepseek-ai/dsh-command-compactdisabled: truein dsh web-profile presets.compaction-basicis the right target (its auto-compression checkpoints shadowed the fold substrate, #1729), butcommand-compactcarries the EXPLICIT/compactcommand — the DSH-official bridge third-party plugins borrow viactx.commands.find(agent, "compact")(e.g. dsh-switchman's/ctx-handover). Disabling it made those plugins degrade toundefinedwith 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):
dsh.keepCommandCompactbillion-context.json)falsecompaction-basic;command-compactrows pass through untouchedBILI_DSH_KEEP_COMMAND_COMPACTfalseWhy 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: reusingdsh.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
command-compactrows are no longer disabled →/compactis reachable again in web-profile presets andctx.commands.findconsumers work. A/compact-triggered compaction call STILL passes the nudge 死锁无检测:同一 session 交替收到两种结构互斥的请求流(巨型单消息 ↔ 多轮)时不告警 #1729 wire guard: with active fold blocks it is answered locally by bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733 authored compaction (zero egress); otherwise the terminal, diagnosable refusal fires. Keeping the explicit command does NOT re-introduce nudge 死锁无检测:同一 session 交替收到两种结构互斥的请求流(巨型单消息 ↔ 多轮)时不告警 #1729's silent checkpoint shadowing — that mechanism lives in the auto path (compaction-basic), which stays disabled.countCompactionRowstakes it), so covered-row counts can never drift from what the rewrite actually did."active"to{active: true, keepCommandCompact?}; the reader tolerates the legacy string so mixed-version mid-update windows degrade to today's behavior.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
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 viaBILI_CONFIG_FILE).npm run typecheckclean. Full suite = CI.