Repository navigation
Releases: DDDMUC/dsh-delete-turn
Release list
v0.1.15 - feat: 设置卡导出给组合包
v0.1.14 - 静默载体按适配器判定 + 轮次导航修正
变更
- 静默载体按会话判适配器:删除载体原来在加载时只看
dsh-llm-pi-ai是否打了dsh-delete-turn:skip-empty-user,所以用 DeepSeek 适配器的宿主也一直写零宽空格 —— 模型能看到它。现在按会话日志里的model/selection取 provider,再查ctx.llm.adapters里该 provider 的适配器是否原生丢弃空 user/assistant 消息(DeepSeek 适配器有prepareExtensions,pi-ai 没有),是就用空载体,判不出来仍旧用零宽兜底。 - 轮次导航不再被误删:
跳转到第 N 轮的 N 是真实轮号,旧代码把它当位置序号去匹配data-chat-turn,在只加载后段回合的会话里把存活的标记当成空回合隐藏 —— 实测出现过「对话视图 10 轮、导航只剩 2 轮」以及长会话导航整条空掉。 - 与对话视图对齐:导轨给会话里每一轮留一个标记;一轮「在视图里」= 它有行且至少一行可见。有行但全部隐藏 → 隐藏它的标记,其余标记按序重排并在宿主自己的梯子里居中;容器高度保持宿主原值(宿主虚拟化按它测量窗口,改小会让后面的标记被卸载);完全没有行的轮次(只是没加载)保持不动。
- 文档:
CHANGELOG.md里重复且措辞相反的英文 0.1.14 条目合并为一条,测试数改为 73。
验收
npm test73/73。- 真页面复验(会话
64d9dc8b):日志轮 1..34、DOM 渲染 10..34(25 轮)、导轨 34 个标记;retiredTurns18 轮隐藏后可见轮与模型可见轮一致。
Changes
- Silent carrier determines adapter per session: Previously, when loading, the carrier only checked whether
dsh-llm-pi-aihaddsh-delete-turn:skip-empty-userapplied, so hosts using the DeepSeek adapter also always wrote a zero-width space — and the model could see it. Now the provider is taken frommodel/selectionin the session log, and thenctx.llm.adaptersis checked to see whether the adapter for that provider natively drops empty user/assistant messages (the DeepSeek adapter hasprepareExtensions, while pi-ai does not). If so, an empty carrier is used; if it cannot be determined, the zero-width fallback is still used. - Turn navigation is no longer mistakenly deleted: The N in
jump to turn Nis the real turn number. The old code treated it as a positional index to matchdata-chat-turn, and in sessions where only later turns were loaded, it hid surviving markers as empty turns — in actual testing this produced cases such as "the conversation view has 10 turns, but navigation has only 2 turns left," and in long sessions the entire navigation strip became empty. - Aligned with the conversation view: The rail leaves one marker for each turn in the session; a turn is "in the view" = it has rows and at least one row is visible. If it has rows but all are hidden -> hide its marker, reorder the remaining markers sequentially and center them in the host's own ladder; the container height remains the host's original value (the host virtualizes and measures the window based on it; reducing it would cause subsequent markers to be unmounted); turns with no rows at all (simply not loaded) remain unchanged.
- Documentation: The duplicate and contradictory English 0.1.14 entries in
CHANGELOG.mdwere merged into one, and the test count was changed to 73.
Acceptance
npm test73/73.- Re-verification on the real page (session
64d9dc8b): log turns 1..34, DOM rendering 10..34 (25 turns), rail with 34 markers; after 18 turns ofretiredTurnswere hidden, the visible turns matched the turns visible to the model.
v0.1.13 - 生成中删除先停止 + 强制确认
变更
- 生成中删除 = 先停止,再删除:走官方
sessionController.cancel(与 UI 停止键同一条路,保留排队的输入),等turn/end落地后再删;默认等待上限 15 秒,超时返回stop-timeout。正在压缩或停止被拒时仍拒绝并说明原因。 - 窗口里夹着别的内容不再直接拒绝,改为强制询问:第一次请求只回报会多删 N 项(
range-not-clean+details.foreign),客户端把确认框切成强制询问(主按钮「一并删除」),确认后才带force执行。自有占位符与其他插件的静默载体仍免费骑过。 - 文档:更新日志拆到独立的
CHANGELOG.md(中英分节),README 保留链接,随包发布。
验收
- 72 例测试全绿(64 → 72)。
- 契约测试:一次 append、轮号不变、严格冷读通过。
Changes
- Deletion during generation = stop first, then delete: Goes through the official
sessionController.cancel(the same path as the UI stop button, preserving queued input), and deletes only afterturn/endhas landed; the default wait cap is 15 seconds, and timeout returnsstop-timeout. If compression is in progress or the stop is rejected, the request is still rejected with an explanation. - When the window contains other content, no longer reject outright; instead require forced confirmation: The first request only reports that N extra items would be deleted (
range-not-clean+details.foreign), and the client switches the confirmation dialog to a forced prompt (primary button “Delete Together”); only after confirmation does it execute withforce. Native placeholders and other plugins’ silent carriers still ride through for free. - Docs: The changelog has been split into a standalone
CHANGELOG.md(separate Chinese and English sections), README keeps a link, and it ships with the package.
Acceptance
- All 72 tests green (64 → 72).
- Contract tests: one append, turn number unchanged, strict cold read passes.
v0.1.12 - 失败卡随轮隐藏 + 头保护规则修正
修复
- 整轮删除后,回合级的披露行(「处理失败」「已思考」「重试」等)不再残留:这些行按「回合」绘制、不挂在被遮蔽的节点上,删光一轮的内容后曾变成孤儿;现在某一回合只要没有可见的内容行,它的披露行(
turn-error/model-retry/turn-tail/turn-process)一并隐藏。 - 系统提示词头的保护规则改为「窗口不得覆盖 surface 节点 0」:宿主每轮重写系统提示词头,重写后的头带的是当前轮号,旧的「头所在轮不可删」判据会误拒当前轮(真实会话上复现)。头本身仍不可删;引入它的那一轮可正常整轮删除。
其它
- README 中测试用的真实会话 id 隐去。
验收
- 64 例测试全绿;契约测试用平台真实校验器验证一次 append、轮号不变、严格冷读通过。
- 实机(0.2.1-alpha.2 web :3080)验证:已服务 client 含披露行跟随隐藏逻辑;
/state的turnSeqs含此前被误拒的那一轮。
v0.1.11 - 整轮删除改为单次范围替换
重构
- 「删除这一轮」不再重放后续轮次:改为一次普通的 surface-replace(窗口 = 该轮全部表面节点),后面的轮次原地保留、编号不变——不重放、不重编号、不碰代理循环,日志只多一条事件。
- 移除
mode: 'splice'及buildSpliceReplayWrites/planSplice/spliceableSeqs/syncLoopTurn;/state的spliceSeqs更名为turnSeqs(由turnableSeqs广告,仍是「广告即承诺」)。 - 与 dsh-rerun-turn 的载体互操作不变(
plugin:dsh-delete-turn+ 无可读内容)。
验收
- 62 例全绿;契约测试用平台真实校验器证明:一次 append、轮号不变、严格冷读通过、之后循环开的新轮仍可读。
- 实机 :3080 验证:已服务 client 含
turnSeqs/dshdt-turn,/state返回turnSeqs。
v0.1.10 - 插件页「删除时询问」设置
新特性
- 插件页新增可点配置入口(组件行入口
plugins.row.config),提供「删除时询问」复选框:勾选=每次删除前弹确认框;取消勾选=直接删除。 - 直接删除失败时仍会弹出带错误信息的对话框,便于重试或取消。
其它
- 客户端
dsh.client.inject增加@deepseek-ai/dsh-client-ui-plugin-manager;dsh引擎下限提升到>=0.1.7-rc.1。
v0.1.8 - hide a deleted row that names its replacement carrier
A deleted message left an empty bubble behind: the deletion landed and the model
context lost the message, but the transcript row stayed on screen drawing the
carrier's empty content.
Root cause
From a live session's /state: hidden is keyed by the seq the log recorded as
shadowed (7102), while the transcript row names the LIVE node - the carrier the
plugin appended (7106) - and edits contained no pair bridging them, because
contentEditPairs deliberately excludes this plugin's own carriers. The row was
therefore never matched and never hidden.
Fix
The host already publishes the link on every hidden entry, so the browser half
now indexes it (hiddenVia: replacement seq -> shadowed seq) and the hide check
consults both. Client only; no host, route, or log-format change.
Guards
Two cases in test/client.test.js - a row naming the carrier is hidden, and a row
naming the shadowed seq still is. Verified negatively: reverting the hiddenVia
lookup turns exactly the first one red. 38 tests pass.
Also
Records the measured reason the deletion carrier is a zero-width user message and
not an empty one: probed against the deployment provider, an empty user message is
refused with 400 user message must have content while the session append accepts
it. The zero-width space is load-bearing; a global capability probe cannot relax
it, because the adapter in play depends on the session's provider.
v0.1.5 · 删除对模型无痕 + 兼容就地改写 + 清理残留壳
修复
1. 删除对模型彻底无痕
之前的删除载体里写的是可见的 [deleted] 文本,模型会读到并复述("earlier content came through as [deleted]");改成空内容又会被请求网关拒绝:400 user message must have content(两条路径都实测确认)。现在载体只放一个零宽空格(U+200B)——对格式校验和网关都是"有内容",对模型没有任何可读文本。
2. 兼容被「就地改写」的消息(如 dsh-edit-turn 编辑过的行)
- 宿主
GET /dsh-delete-turn/state新增edits:其他生产者发起的单节点、同类型替换会以from → to形式暴露(压缩检查点与本插件载体除外),同时surface改用官方 live surface,和删除校验完全一致。 - 客户端沿这条链把行解析到当前活节点:被改写过的行不再丢删除入口;删除命中的是活节点,删完原行也会随链隐藏。
3. 陈旧目标自动重试
点「删除」提交前会强制重读一次状态并把目标解析到当前链头;若宿主仍回 already-deleted 且链头已经变化,自动重试一次。修掉"提示已从上下文删了、但行不消失"。
4. 清掉两类宿主包装残留
- 过程分组壳(
["process", …]复合行)跟随它的锚成员节点一起隐藏; - 右侧**「轮次导航」**轨道:某一轮的行全部不可见时,该轮刻度隐藏;所有刻度都不可见时整条轨道隐藏。
兼容性
- 新增实测:DSH
0.2.0-rc.1(web 与 desktop profile)。 - 宿主半区改动需重启 DSH 生效;客户端改动刷新页面即生效。
升级
dsh plugin --profile web add dsh-delete-turn@0.1.5Fixes
1. Deletion is now completely silent on the model side
The carrier used to contain a readable [deleted] marker, which the model read and quoted back ("the earlier content came through as [deleted]"); switching to empty content is refused by the request gateway with 400 user message must have content (both paths verified live). The carrier now holds a single zero-width space (U+200B): "has content" for every validator and gateway, no readable text for the model.
2. In-place rewrites are followed (dsh-edit-turn edited rows)
GET /dsh-delete-turn/statenow exposesedits: single-node, same-type replacements landed by other producers are reported asfrom → topairs (compaction checkpoints and this plugin's own carriers excluded), andsurfacenow uses the official live surface, exactly what a delete is validated against.- The client resolves a row through that chain to its live node: rewritten rows keep their delete action, the delete hits the live node, and the original row hides with the chain.
3. Stale targets retry automatically
Submitting a delete now re-reads the state, re-resolves the target to the current chain head, and retries once when the host still answers already-deleted after the head moved. Fixes "it says the content is already deleted but the row stays".
4. Wrapper leftovers are cleared
- Process-group rows (
["process", …]) hide together with their anchor member; - The right-hand turn-navigation rail drops marks for turns whose rows are all invisible, and the whole rail hides when none remain.
Compatibility
- Newly verified on DSH
0.2.0-rc.1(web and desktop profiles). - Host-side changes need a DSH restart; client-side changes apply on refresh.
Full Changelog: v0.1.4...v0.1.5
v0.1.4 · 新会话立即可删 & 移除过程行重复入口
修复
1. 新会话里的删除入口不再需要刷新页面
之前刚发出的消息在刷新页面之前拿不到删除按钮:客户端把 /state 快照当成"全部事实",快照之后才出现的行被判定为"没有可删目标"。
- 行的全部事件都晚于快照时间点时,视为快照尚未覆盖的新内容,保持可删;
- 转录继续增长时节流重读快照(最短 3 秒一次),让隐藏台账与判定条件自动跟上;
- 宿主端仍然逐次校验删除目标,安全边界不变。
2. 移除过程行上的重复删除入口
「已思考 / 用时 N 秒」这类过程行右上角、悬停才出现的删除图标已移除。它的删除范围与底部官方操作条完全相同(整条回复),属于重复入口;删除整条回复请继续使用官方操作条。失败回合行(出错 / 模型重试)仍保留兜底入口。
说明
- 本次只改客户端半区:刷新页面即生效,无需重启 DSH。
- README(中 / 英)已同步更新对应的行为说明。
升级
dsh plugin --profile web add dsh-delete-turn@0.1.4Fixes
1. Delete actions appear immediately in a live session (no page refresh)
Before, a message sent in the current session had no delete action until the page was refreshed: the client treated the /state snapshot as the whole truth, so rows appended after it were flagged as "no target".
- A row whose events are all newer than the snapshot is now treated as not yet covered by it and stays actionable;
- The snapshot is re-read (throttled to at most once every 3s) as the transcript grows, keeping the hidden ledger and the gates current;
- The host still validates every delete target, so the safety boundary is unchanged.
2. Removed the duplicate delete entry on the process row
The hover-only trash icon at the top-right of the process/disclosure row (“Thinking”, “N s”) is gone. Its scope was identical to the official action strip below (the whole reply), so it was a duplicate; use the action strip to delete a whole reply. Failed turns (turn errors / model retries) keep their fallback entry.
Notes
- Client-only change: a page refresh is enough, no DSH restart needed.
- README (zh/en) updated to match.
Full Changelog: v0.1.3...v0.1.4