@michengai/dsh-archive-manager 1.1.20 → 1.1.21

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
@@ -4,6 +4,12 @@
4
4
 
5
5
  Published release notes are retained below; new versions are added without removing earlier entries.
6
6
 
7
+ ## 1.1.21 - 2026-10-30
8
+
9
+ - Fix failure deleting active sessions with corrupt transcripts or missing tool call IDs (#101):
10
+ - Resolves an issue where sessions failed mid-turn due to missing `toolCallId` or format errors (such as `SessionFormatError: format v4 tool/result requires toolCallId matching its tool source`) could not be deleted from the sidebar context menu because the host's flush barrier re-threw the corruption error.
11
+ - Caches live session headers prior to deletion and degrades flush barriers into fail-soft operations, ensuring write handles are detached and transcript directories/workspace memberships are cleanly purged even when transcripts are damaged.
12
+
7
13
  ## 1.1.20 - 2026-10-30
8
14
 
9
15
  - Remove dead legacy workspace browser code and unconsumed locales (#100):
@@ -4,6 +4,12 @@
4
4
 
5
5
  以下发布说明会持续保留;新增版本时不再删除较早记录。
6
6
 
7
+ ## 1.1.21 - 2026-10-30
8
+
9
+ - 修复运行失败或转录损坏的活跃会话无法删除的缺陷(#101):
10
+ - 当会话因模型缺少 `toolCallId` 等原因抛出 `SessionFormatError` 导致本轮运行失败时,从侧栏右键菜单直接删除该会话不再被宿主 `flush` 屏障再次报错阻断;
11
+ - 预先捕获内存中活跃会话的头部索引,将删除前落盘操作改造为容错机制,确保无论日志是否损坏均能强制分离写句柄并彻底销毁物理转录目录及工作区成员绑定。
12
+
7
13
  ## 1.1.20 - 2026-10-30
8
14
 
9
15
  - 清理已废弃的历史工作区浏览器死代码与未消费文案(#100):
package/lib/workspace.js CHANGED
@@ -804,9 +804,24 @@ var ArchiveWorkspaceRegistry = class extends WorkspaceRegistry {
804
804
  const sessions = this.ctx.get("sessions");
805
805
  const live = sessions?.get(sessionId);
806
806
  if (live !== void 0) {
807
- await sessions.flush(live);
808
- const entry = sessions.liveEntryFor(live);
809
- sessions.detachEntered(entry);
807
+ if (live.header !== void 0) {
808
+ this.headers?.set(sessionId, live.header);
809
+ }
810
+ try {
811
+ await sessions.flush(live);
812
+ } catch (error) {
813
+ this.ctx.logger.warn(
814
+ `archive-manager: could not flush live session "${sessionId}" before deletion: ${String(error)}`
815
+ );
816
+ }
817
+ try {
818
+ const entry = sessions.liveEntryFor(live);
819
+ sessions.detachEntered(entry);
820
+ } catch (error) {
821
+ this.ctx.logger.warn(
822
+ `archive-manager: could not detach live session "${sessionId}" before deletion: ${String(error)}`
823
+ );
824
+ }
810
825
  } else if (sessions !== void 0)
811
826
  await this.publishColdSessionRemoval(sessionId, sessions);
812
827
  const projCache = this.ctx.get("sessionProjectionCache");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michengai/dsh-archive-manager",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "description": "归档、恢复、收藏和永久删除会话,并诊断损坏的会话日志。 · Archive, restore, favorite, and permanently delete sessions, and diagnose damaged session logs.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.22.0",