Repository navigation
feat(dsh): ship in-package bili preset as the roster default (#1772) [discussion draft] - #1827
Closed
ranxianglei wants to merge 1 commit into
Closed
ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
Discussion draft — approach proven end-to-end against dsh 0.2.0-rc.2 on a live probe instance; NOT for merge until the open decisions below are settled. The #1786 recipe (copy standard into the user root by hand) works but is three steps across two worlds, and user copies drift on preset upgrades. Interception is worse: compaction-basic exposes no service or veto API (pure event listeners), vetoing agent/pre-step starves 16 sibling listeners, wrapping ctx.llm fights the core. The remaining sanctioned lever is the `agent-presets` row itself — a boot-tree row the web-app inserts, so the LAST bundle layer (bili) can replace its config wholesale: - dsh-presets/standard-bili-auto-off/: byte-copy of the shipped `standard` preset with exactly one delta — compaction-basic `config: { auto: false }` (it only registers automatic compaction when this.config.auto). Manual /compact (command-compact) and the tool-result pruner stay. Ships in the npm package, so every bili upgrade refreshes it — no snapshot drift. - dsh.bundle.patch.yml: replace the never-applied compaction-basic corpse row (preset-internal rows are below the patch engine's reach — that was the #1772 dead end) with an `agent-presets` config override: extra roster root pointing at the package's dsh-presets/ (path resolved from the loader ctx baseUrl at activation, win32 leading-slash handled), trust: system, default switched to the bili preset. Shipped + user roots stay enabled; every native preset remains selectable; an explicit settings/UI choice still wins over the row-config default. - package.json: publish dsh-presets. - tests/e2e/e2e-native-dsh.test.ts: wireProfile copies dsh-presets/ like a registry install would. - tests/dsh-bundle-preset.test.ts: guards — exactly one agent-presets patch row with default + package-relative root + win32 handling; preset keeps auto:false while command-compact and tool-result-pruner rows survive; package files and the e2e mirror stay in sync. Open decisions: (a) default override on/off (on = zero-action fix for existing installs; off = picker-only); (b) preset display name (标准模式(bili 托管压缩)) — both flagged in the #1772 discussion comment.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1804-pr.1827.777d327This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1827.tgz
npm install -g packageInstall instructions are refreshed on each push. |
This was referenced Oct 1, 2026
antclt
pushed a commit
to antclt/billion-context
that referenced
this pull request
Oct 1, 2026
…y gate dsh-compaction-basic answers context pressure by replaying the whole conversation prefix and appending its fixed COMPACTION_INSTRUCTION as the final user message, under the SAME session id (KV prefix-cache reuse). In the desktop lane those calls ride bili as a second producer on the main conversation — the ranxianglei#1729 deadlock — and when one lands, dsh durably shadows the replayed surface range: the original messages never ride a future request again, destroying the proxy's compression substrate. That loss is irreversible; every cost of refusing is dsh-side, caught, and recoverable, so the guard is unconditional. - src/server/dsh-compaction-guard.ts: two-signal AND identification (per the claudeSubagentSplit ranxianglei#970 discipline — both signals must agree, failure direction is "stop intercepting"): 1. MARKER: final user message starts with the versioned instruction prefix (verbatim from @deepseek-ai/dsh-compaction-basic, tracked per dsh release like MAIN_SYSTEM_PREFIXES); 2. SHAPE: whole request <= 4 messages (observed live: 2 msgs at ~152K tokens in the ranxianglei#1727 logs; a normal turn — even one quoting the template — carries its full history and cannot fit). openai + anthropic wire shapes; google/responses out of scope v1. - src/server.ts: guard runs after identity resolution, BEFORE the ranxianglei#388 side-request lane and any pipeline work — refused locally (403, non-retryable, protocol-shaped), kernel state untouched, WARN once per session. Not gated on the dsh plugin marker: a dsh host routed through a global bili without the plugin bundle is covered too. The refusal message rides into dsh's own warn line ("step compaction failed: <message>; continuing the turn"). - tests/dsh-compaction-guard.test.ts: 10 cases — observed production shapes, content-parts, anthropic shape, quoting/mid-history non- matches, count bar, protocol scope, refusal bodies, live-template prefix check. Deliberate residual costs, on record: manual /compact is refused too (same envelope — the traffic layer cannot tell the trigger), and dsh's context-overflow recovery loses its compaction path (the original 400 surfaces; bili's nudge/truncate is the defense). The source-layer fix (preset auto:false, ranxianglei#1827) remains complementary: it makes dsh not even try, so nothing reaches this gate. Refs ranxianglei#1729 (deadlock producer), ranxianglei#1772/ranxianglei#1827 (source-layer preset), ranxianglei#1206 ([conflict] name-scan), ranxianglei#394 (shared-session hazard class).
Owner
Author
|
(ai: zhipuai-lb/glm-5.3) 孤儿票清理:标题指向的 issue 已关闭,修复已由其他路径落地。关单;误判请 reopen。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Discussion draft — not for merge. Approach proven end-to-end on a live probe instance (dsh 0.2.0-rc.2): booted a web profile with this exact bundle-patch overlay,
POST /api/agentPresets/listreturns all four native presets plusstandard-bili-auto-off(trust: system,isDefault: true).Why not interception (investigated, all rejected)
dsh-compaction-basicexposes no service / veto API — it is pure event listeners (agent/pre-steppressure trigger,agent/request-erroroverflow recovery) and only registers them when its row config hasautotruthy.agent/pre-stepevent chain would starve 16 sibling listeners (dsh-agent, time-context, tool-cordis, plan-mode, …) — sledgehammer.ctx.llmto intercept the summarize call overrides a core service; monkey-patching loaded modules in-process is hostile and version-fragile.The sanctioned lever
The web-app inserts the
agent-presetsrow at boot-tree top level, and bili is the last bundle layer — so its bundle patch can replace that row's config wholesale:dsh-presets/standard-bili-auto-off/): byte-copy of shippedstandard, exactly one delta —compaction-basicgetsconfig: { auto: false }. Manual/compactand the tool-result pruner stay. Every bili upgrade refreshes it → no snapshot drift, zero user files touched.dsh.bundle.patch.yml: the oldcompaction-basicpatch row (never applied — preset-internal rows are below the patch engine's reach; that was thedsh.bundle.patch.yml禁用自动压缩在 web profile 下静默失效 #1772 dead end) is replaced by theagent-presetsconfig override: extra roster root → package-relativedsh-presets/(resolved from the loader ctxbaseUrl, win32 leading-slash handled),trust: system, and default → bili preset.Open decisions (why this is a draft)
dsh.bundle.patch.yml禁用自动压缩在 web profile 下静默失效 #1772 closes itself); off = preset appears in the picker only, warning points at it.标准模式(bili 托管压缩); earlier…无自动压缩was ambiguous.standard— release-managed per bili release; needs a note in CLIENTS.md once the approach is blessed.Supersedes the manual-recipe automation sketched in #1786 (docs there stay valid as background).