dsh-live-compact 1.1.9 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # 版本变更
2
2
 
3
+ ## 1.1.10
4
+
5
+ - **billion-context 兼容保持**:保留对方接管官方压缩时的让位边界。
6
+ - **真实 CLI 轮末小切修复**:在 DSH `agent/turn-stopping` 的 live-agent 窗口执行维护与 catch-up;CLI agent 随后 dispose 时,已开始的本地小切不再被 `runMaintenance` 吞掉。`turn/end` 继续作为兜底。
7
+ - **真实验证**:GLM 5.3 Flash 隔离 DSH session 在 51,827 tokens 时提交一刀,切段 12,162 tokens,实际 saved 10,701 tokens;定向回归 10/10,完整 gate 与 Cordis 兼容门禁随发布重跑。
8
+
3
9
  ## 1.1.9
4
10
 
5
11
  - **billion-context 兼容保持**:保留 1.1.7/1.1.8 的让位边界;检测到 billion-context 接管官方压缩时,Live Compact 不改写对方正在接管的会话。
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  完整数据、原始口径和限制见 [docs/benchmarks.md](docs/benchmarks.md),结构化数字见 [docs/benchmark-results.json](docs/benchmark-results.json)。
10
10
 
11
11
  - **1.0.5 失忆对比**:同一真实 DeepSeek 会话,15 道回忆题两边都是 15/15;Live Compact 的日志中段细节两次都是 3/3,原版一次 1/3、一次 3/3。
12
- - **历史 DSH 长链路**:早期 150 道短题和 20 道 WebUniverse 连续任务都保留了原版/Live Compact 对照表;它们是历史实测,不是 1.1.9 的新验收。
12
+ - **历史 DSH 长链路**:早期 150 道短题和 20 道 WebUniverse 连续任务都保留了原版/Live Compact 对照表;它们是历史实测,不是 1.1.10 的新验收。
13
13
  - **OpenCode 移植参考**:独立项目 [opencode-live-compact](https://github.com/Haoming9527/opencode-live-compact) 把插件移植到 OpenCode,和 OpenCode 自带的 autocompact 做了对照:在 OpenCode 2.2.6 + GPT-6 Luna 上跑 Aider 150 和 Web-Bench React 20,任务分别 150/150、20/20 且最终浏览器测试 59/59;估算费用分别低 14.3% 和 42.1%。这是 OpenCode 项目的结果,用来说明移植后的可复核测评方法,不冒充 DSH 运行结果。
14
14
 
15
15
  ![早期 DSH 两场实测](docs/slide-results.jpg)
@@ -31,13 +31,13 @@
31
31
  headless:
32
32
 
33
33
  ```sh
34
- dsh plugin --profile headless add dsh-live-compact@1.1.9
34
+ dsh plugin --profile headless add dsh-live-compact@1.1.10
35
35
  ```
36
36
 
37
37
  网页端:
38
38
 
39
39
  ```sh
40
- dsh plugin --profile web add dsh-live-compact@1.1.9
40
+ dsh plugin --profile web add dsh-live-compact@1.1.10
41
41
  ```
42
42
 
43
43
  想先装到本机看版本:
@@ -189,8 +189,8 @@ Windows 会重新设置备份访问权限,失败时停止写备份并保留原
189
189
  从 npm 装。headless 和网页是两个 profile,要各装一次。桌面端是另一个 profile,普通 `dsh plugin --profile desktop` 会被拒绝。
190
190
 
191
191
  ```sh
192
- dsh plugin --profile headless add dsh-live-compact@1.1.9
193
- dsh plugin --profile web add dsh-live-compact@1.1.9
192
+ dsh plugin --profile headless add dsh-live-compact@1.1.10
193
+ dsh plugin --profile web add dsh-live-compact@1.1.10
194
194
  ```
195
195
 
196
196
  想先装到本机看版本:
@@ -203,9 +203,9 @@ dsh-live-compact --version
203
203
  上不了 npm 时的镜像安装命令:
204
204
 
205
205
  ```sh
206
- dsh plugin --profile headless add https://download.merkyorlynn.com/downloads/plugins/dsh-live-compact-1.1.9.tgz
207
- dsh plugin --profile web add https://download.merkyorlynn.com/downloads/plugins/dsh-live-compact-1.1.9.tgz
208
- npm install -g --force "https://download.merkyorlynn.com/downloads/plugins/dsh-live-compact-1.1.9.tgz"
206
+ dsh plugin --profile headless add https://download.merkyorlynn.com/downloads/plugins/dsh-live-compact-1.1.10.tgz
207
+ dsh plugin --profile web add https://download.merkyorlynn.com/downloads/plugins/dsh-live-compact-1.1.10.tgz
208
+ npm install -g --force "https://download.merkyorlynn.com/downloads/plugins/dsh-live-compact-1.1.10.tgz"
209
209
  dsh-live-compact --version
210
210
  ```
211
211
 
package/index.js CHANGED
@@ -791,6 +791,9 @@ export default class SpineCompactionEngine extends BasicCompactionEngine {
791
791
  await this.waitForMaintenance(agent, signal);
792
792
  return typeof next === "function" ? next() : undefined;
793
793
  });
794
+ ctx.on("agent/turn-stopping", async ({ agent, signal }) => {
795
+ await this.runTurnStoppingMaintenance(agent, signal);
796
+ });
794
797
  } catch (error) {
795
798
  const message = error instanceof Error ? error.message : String(error);
796
799
  ctx.logger?.warn?.(`spine: 本会话未接管自动小切。${message}`);
@@ -884,6 +887,36 @@ export default class SpineCompactionEngine extends BasicCompactionEngine {
884
887
  this.pendingCuts.add(job);
885
888
  }
886
889
 
890
+ async runTurnStoppingMaintenance(agent, signal) {
891
+ if (this.standDown?.() || signal?.aborted) return;
892
+ const state = this.stateFor(agent);
893
+ if (state.warming) {
894
+ state.turnEndPending = true;
895
+ return;
896
+ }
897
+ state.warming = true;
898
+ try {
899
+ const settings = readSettings(this.liveConfig);
900
+ const events = agent.session.snapshotEvents();
901
+ let catchup = { finished: true, progressed: false, retryRequested: false };
902
+ if (events.length > CAPTURE_EVENT_BATCH) {
903
+ catchup = this.scheduleCaptureCatchup(agent, events, settings, { freezeSnapshot: true });
904
+ } else {
905
+ await this.flushPendingCaptures();
906
+ this.captureNew(agent.session, events, settings);
907
+ }
908
+ if (catchup?.promise && !catchup.finished) await catchup.promise;
909
+ await this.flushPendingCaptures();
910
+ await this.finishTurn(agent, events, { maintenanceRetry: true, skipCapture: true });
911
+ } finally {
912
+ state.warming = false;
913
+ if (state.turnEndPending) {
914
+ state.turnEndPending = false;
915
+ this.scheduleTurnEndMaintenance(agent, state.turnEndSeq);
916
+ }
917
+ }
918
+ }
919
+
887
920
  scheduleTurnEndMaintenance(agent, seq, boundaryEvent = null) {
888
921
  if (this.standDown?.()) return;
889
922
  const state = this.stateFor(agent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-live-compact",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "In-place newest-turn compaction for DeepSeek Harness. Compress while the task runs and keep the prefix.",
5
5
  "license": "MIT",
6
6
  "author": "MerkyorLynn <268568828+MerkyorLynn@users.noreply.github.com>",