Skip to content

Releases: xohmai/dsh-session-delete

v0.5.0

Choose a tag to compare

@xohmai xohmai released this 14 Oct 01:28

大列表秒开 + 修复 IM 渠道会话无法删除(#3)

数百个会话(实测 520+ 个 / 400MB 日志)首次加载从 60s+ 降到亚秒级;IM 渠道(微信等 dsh-im-connect 接入)会话此前完全无法删除/还原,本版起支持。

大幅提速

  • 列表改为流式:新增 GET /list-stream(NDJSON)先发总数、再逐会话吐行,加载进度实时可见(「已加载 N / M 个会话」);旧 /list 路由保留兼容
  • 标题解析重构:冷会话优先走 DSH 投影缓存(与侧栏 session.list 同源、零解压、identity 见证防串会话),仅未命中者合并成一次批量解压——修复 v0.4.x 逐会话调用的准平方级开销(520 会话 60s+ 跑不完)
  • 三阶段流水线(并行 stat 预检 → 批量标题解析 → 16 路行池)+ mtime 记录缓存:重复加载只剩 stat 成本
  • 修复 mtime 缓存对未迁移旧格式(v0)会话永不命中的问题(locate() 返回当前代路径,v0 会话磁盘上只有旧代文件,stat 必 ENOENT)——8s 稳态的元凶
  • 修复投影缓存对旧格式 header(缺 isSeeded)identity 全部落空的问题:重启后的首次加载不再退回全量解压

体验

  • 首次加载过渡动画水平垂直居中,带实时计数;回收站页签同款居中动画(其接口毫秒级,无需计数)
  • 切换页签不再重新加载(仅数据为空时拉取);带数据的重新加载静默刷新,旧列表保持可操作

修复:IM 渠道会话(#3)

DSH 核心约定 SessionId 是 unvalidated 字符串(落盘前必须转义),插件此前错误假设 id 是文件系统安全的:

  • id 白名单放宽为纯防注入([A-Za-z0-9._:@~-]{8,200},仍拒绝 / \ 空白),含 :/@ 的 IM id(如 im:weixin_…@im.wechat)不再被 400 误杀(删除/预览/解除归档全解锁)
  • 回收站条目名改用与核心 encodeSegment 逐字对齐的 ~XXXX 转义(:→~003A、@→~0040),Windows 保留字符安全;还原/清空的 id 始终取自条目内 meta.json,绝不反解条目名
  • ENTRY_RE 同步收紧为转义输出字符集(含 ~、绝不含 :/@);转义膨胀越界的极端 id 在动手前拒绝,维持「凡删除成功创建的条目必然能还原」不变式

诊断

  • /list-stream 的 done 行携带各阶段耗时(inventoryMs/prepMs/titleMs/rowMs)与标题来源计数(recordCache/snapshot/predecessor/batched)

升级

dsh plugin --profile web add github:xohmai/dsh-session-delete#v0.5.0

装完重启 dsh web 生效;旧版 DSH(≤0.1.1-rc.x)同样兼容。

v0.4.1

Choose a tag to compare

@xohmai xohmai released this 10 Sep 07:27

修复:支持 DSH 0.1.5

DSH 0.1.5 起 sessionPersistence.list() 返回 { header, revision, sizeBytes } 快照数组(旧版直接返回 header 数组)。v0.4.0 把包装对象当 header 用,/api/session-delete/list、/trash 全部 500:

Cannot read properties of undefined (reading 'length')

变更

  • 兼容解包两代返回形状(与官方 session-query 同款解包),新旧 DSH 均可运行
  • 冒烟测试默认按 0.1.5+ 快照形状打桩,另加旧形状专项回归
  • react/react-dom 18.3.1 转为 devDependencies(新版 DSH 不再自带 react)

升级

dsh plugin --profile web add github:xohmai/dsh-session-delete#v0.4.1

装完重启 dsh web 生效。

v0.4.0 — 彻底修复:删除会话后在侧栏复活(含批量删除)

Choose a tag to compare

@xohmai xohmai released this 27 Aug 08:42

彻底修复「删除后又回到工作区」

0.3.0 只覆盖了「打开中」的 live 会话;批量删除归档会话仍会复活。完整根因:客户端侧栏的行来自内存 list store,只有 host/session-removed 帧(仅 live 会话 dispose 时宿主才发)或全新 session.list 基线才能把行移除。冷会话被删后宿主不发任何帧,行一直留在所有已连接客户端的 store 里——此时摘除归档 id 会广播 archived-sessions-changed,把残留行重新显示出来。

修复策略

  • 运行期间永不摘除归档 id(delete / purge / 清空回收站一致):归档只是隐藏标记,没有行数据的 ghost id 在官方 UI 里不渲染任何东西,保留代价为零
  • ghost 统一在宿主重启时清理(插件挂载时 reconcile 一次):重启后所有客户端都用全新基线重建 store,已删会话的行不复存在,此时摘除绝对安全
  • /list 不再在运行期间 reconcile(那个广播本身就是复活诱因)
  • 操作方客户端删除 / 还原后主动重拉 session.list 基线(sessions.refresh(),能力探测),立即剪掉自己 store 里的残留行

升级

dsh plugin --profile web add github:xohmai/dsh-session-delete#v0.4.0

装完重启 dsh web(重启同时会把历史 ghost 一并清掉)。测试:26 项 smoke + 8 项 render 全绿。

v0.3.0 — 修复:删除「打开中」的归档会话后在侧栏复活

Choose a tag to compare

@xohmai xohmai released this 27 Aug 07:38

修复

删除仍 attach 在宿主内存里的归档会话(「打开中」)后,会话会重新出现在工作区侧栏。 根因:宿主 session.list 无条件从内存吐出活会话,文件进回收站后若把 id 从 archivedSessionIds 摘掉,archived-sessions-changed 广播会让它立即复活。

  • 删除 / 彻底删除 / 清空回收站对 live 会话保留归档隐藏(keptHidden),只对非 live 会话清 ghost;残留的归档 id 在会话不再 live(如宿主重启)后由 /list reconcile 自动收敛
  • /list 的 ghost reconcile 同样跳过 live 会话
  • /delete 响应新增 keptHidden 字段;删除通知会说明「已保持隐藏,重启后彻底消失」

UI 优化

  • 批量「删除所选」改为两步确认(与单条删除、回收站清空一致),改选集/切页签自动解除武装
  • 删除按钮增加说明 tooltip;归档页签在存在「打开中」会话时显示上下文提示

升级

dsh plugin --profile web add github:xohmai/dsh-session-delete#v0.3.0

装完重启 dsh web。测试:25 项 smoke + 8 项 render 全绿。

v0.2.3

Choose a tag to compare

@xohmai xohmai released this 22 Aug 06:26

Fixes

  • Reconcile historical archivedSessionIds ghosts when loading /list.
  • Ids present in workspace.json but missing from the on-disk session inventory are removed best-effort.
  • Completes the v0.2.2 delete/purge cleanup for users who already had leftover ghosts.

Install

dsh plugin --profile web add github:xohmai/dsh-session-delete#v0.2.3

Restart dsh web, then open 设置 → 归档会话 once to trigger reconcile.

v0.2.2

Choose a tag to compare

@xohmai xohmai released this 22 Aug 06:24

Fixes

  • Clear workspace.json global.archivedSessionIds ghosts after delete / purge so the official archive count does not keep deleted sessions.
  • Best-effort only when the workspaceRegistry state machine is available; older DSH builds still cannot rewrite archived ids online.

Install

dsh plugin --profile web add github:xohmai/dsh-session-delete#v0.2.2

Restart dsh web after install / upgrade.

v0.2.1

Choose a tag to compare

@xohmai xohmai released this 22 Aug 06:16

Fixes

  • Accept bare-UUID and <id>-session-<uuid> session ids in the host ID whitelist so continuable / configured subagent sessions can be previewed, deleted, and restored. Thanks @xi146 (#1).
  • Make test/render.mjs resolve react / react-dom from the local DSH install instead of a hard-coded Linux global path.

Install

dsh plugin --profile web add github:xohmai/dsh-session-delete#v0.2.1

Restart dsh web after install / upgrade.

v0.2.0

Choose a tag to compare

@xohmai xohmai released this 20 Aug 01:21

Highlights

Real session deletion for DeepSeek Harness, with online unarchive and a richer trash workflow.

Changes since 0.1.0

  • Online unarchive: restore from the Archived tab returns the session to the sidebar immediately; trash restore also unarchives automatically
  • Older DSH builds without the registry state machine fall back to the offline tools/unhide.mjs guidance
  • Trash entries show session titles (captured into meta.json on delete) with multi-select batch restore / purge
  • Stronger selection styling and unified .sd-check checkbox size across group headers and rows
  • Security and quality: trash entry path traversal guards, audit-log protection, 400 for malformed JSON, per-domain UI loading states

Install

dsh plugin --profile web add github:xohmai/dsh-session-delete#v0.2.0

Or pin the commit / use the latest default branch:

dsh plugin --profile web add github:xohmai/dsh-session-delete

Restart dsh web after install.

Notes

  • npm package name dsh-session-delete is already taken by another project; this release is distributed via GitHub for now.
  • No build step required (plain JS plugin).