DeepSeek Harness Plugin

Jjp-520/dsh-temp-branch

Stars ★ 0 Category Sessions & Messages Added 2026-12-01

Opens a throwaway branch of the current conversation in the right sidebar. It is never listed in the session list, is deleted when closed, and can bring its answer or a summary back into the main chat.

Install

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:Jjp-520/dsh-temp-branch

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

This plugin publishes its README in Chinese only.

在已经开始的对话里开一个临时旁支:开在右侧栏、不进侧栏会话列表、关闭即销毁。

  • 设计文档:docs/2026-11-29-temp-chat-design.md(含实施记录 §12)
  • 实现计划:docs/plans/2026-11-29-temp-chat-plan.md
  • 使用说明(安装/界面/常见问题):使用说明.md

状态

部分 状态
Host:隔离、生命周期、RPC、文件清理 已实现,单测覆盖
客户端:按钮、资源、右栏 tab、嵌入式会话 已实现,真机验证通过
聊天界面 复用官方 conversation.content(embedded)
关闭即销毁 已验证:目录删除、无工作区/缓存残留
带上下文 已实现,真机验证通过(最近 6 轮写成记录作为首条消息)

单测:14 个测试文件 / 80 条用例。

Get-ChildItem tests\*.test.mjs | ForEach-Object { node $_.FullName }

不要用 node --test:本机沙箱禁止 node 以 piped stdio spawn 子进程(EPERM)。

安装

# 从 GitHub 安装(推荐)
dsh plugin --profile desktop add github:Jjp-520/dsh-temp-branch

# 本地开发:链接目录(本机目录名仍是 dsh-temp-chat)
dsh plugin --profile desktop add link:D:\dsh_test\dsh-temp-chat

装完必须重启 DSH(新 bundle 不会热加载)。

用法

  1. 打开任意一个已有对话;
  2. 会话头部有两个圆形按钮(悬停有说明):
    • 蓝色气泡:带上上下文开临时对话——把当前对话最近 6 轮写成一段记录,作为临时会话的第一条消息;
    • 黄色气泡:不带上下文,从空对话开始; 按钮是灰的点不动,说明插件未就绪(悬停显示原因);
  3. 右栏出现临时对话,正常聊天;
  4. 面板左上角两个胶囊按钮:
    • 带回原文:把最后一条回答原样写回主对话(不调模型,最快);
    • 总结并带回:让模型把整段讨论收敛成 3–6 句结论,再写回主对话(模型不可用时自动退回原文); 成功后按钮就地显示「已带回 ✓」约 1 秒;
  5. 会话头部变成红色 ×,点它结束——会话被释放、磁盘文件被删除、右栏收起,主对话不留临时记录。

带回写进主对话的是普通用户消息(带 【来自临时对话】 / 【临时对话的结论】 标记),会留在历史里——这是搬运,不是隐形。

行为说明

  • 开在右侧栏:不浮动、不记忆位置,宽度和位置由右侧栏自己管理(可拖动栏边改宽度)。
  • 不进左侧列表:临时 id 前缀 tchat_,sessionPersistence.list()(async)层过滤,匹配 snapshot.header.id。
  • 不在磁盘留下:当前为 B 模式——会话开着时磁盘上确实有文件,关闭时删除;崩溃残留由 /close-all(页面加载时调用)清理。
  • 不进工作区记录:关闭时从 workspaceRegistry 摘除。
  • 不写投影缓存:sessionProjectionCache.put 对 tchat_ 直接跳过。

已知限制

  • 一个父会话同时只有一个临时对话(单实例)。
  • 页面刷新视为关闭,不会恢复浮窗。
  • 工具在该会话里造成的文件改动不会回滚。
  • 请求仍会发给模型服务商——本地无痕不等于服务端无痕。
  • B 模式下崩溃可能留下 tchat_* 目录;启动清理会处理,也可手动删除 ~/.dsh/sessions/*/tchat_*。

验收脚本

powershell -NoProfile -File scripts/measure-baseline.ps1

关注 tempArtifacts、workspaceTempIds、projcacheEntries 三个数——关闭临时对话前后必须一致(sessionsBytes 会因当前对话本身增长,只看趋势)。

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.