mayf3/dsh-session-doctor

Plugin插件 Native原生 ⭐ 3 MIT Sessions & Context会话与上下文

会话医生:诊断、解卡、读取 DeepSeek Harness 会话

Project Overview项目介绍

This is a purpose-built plugin created exclusively for DeepSeek Harness (DSH), designed to diagnose and unblock stuck DSH agent sessions. It ships with five distinct tools that let users list all active sessions, read full conversation history from any session, check session health, unblock stuck running agents, and send messages to other sessions. It can be installed in three ways: running a one-line terminal command, installing directly from this GitHub repository, or asking any existing DSH agent to run the install command for you. After installation, it automatically mounts and makes all five tools available to every existing DSH session.

When using the plugin, the typical workflow starts when a user notices one of their DSH agent sessions is stuck and not processing new incoming messages. First, they run the list sessions tool to get the ID and current status of the stuck session, then confirm it is stuck by checking its status with the built-in diagnostic tool. Once confirmed, they run the unblock tool, which cancels the stuck running task while preserving all queued messages in the agent’s inbox. After the agent returns to idle status, it automatically processes the queued messages, and users can read the session history to check progress or send new instructions if needed.

The plugin is released under the permissive MIT open source license, so it is free to use, modify, and distribute for any personal or commercial purpose. It has three documented limitations: the unblock tool only works on live running agents, since offline agents do not have active stuck tasks to cancel. When sending a message to an offline session, the plugin will start the session with the default DSH model, and does not carry over any manually selected model from the previous session. It also does not support cross-process or cross-machine session management.

这是一个专为 DeepSeek Harness (DSH) 开发的原生插件,主要功能是诊断、恢复卡死的 DSH 代理会话,同时提供列出所有会话、读取指定会话对话记录、向其他会话发送指令的能力。插件可以通过一行 dsh 命令安装,也可以从 GitHub 拉取安装,甚至可以直接让当前 DSH 会话帮你执行安装命令,安装完成后自动挂载生效,所有现有会话都能直接使用插件提供的五个工具。

典型工作流是用户发现某个会话卡住后,先调用工具列出所有会话确认状态,再诊断目标会话确认卡死,之后调用解卡功能中止卡住的任务,保留排队消息让代理回到 idle 状态自动处理后续任务,还可以读取该会话的历史对话查看进展,必要时发送新指令指挥会话继续。这个插件面向所有日常使用 DSH 多会话工作流的用户,能快速解决会话卡死导致的消息积压问题。

本插件采用 MIT 许可开源,免费供个人和商业使用。当前有三个明确的使用限制:解卡功能仅作用于在线 running 状态的代理,离线会话不存在卡住的活动,因此无需解卡;离线发送消息会用默认模型启动目标会话,不继承上次手动切换的模型选择;不支持跨进程或跨机器的会话通信。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:mayf3/dsh-session-doctor

把 mayf3/dsh-session-doctor 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-session-doctor · 会话医生

English | 中文

诊断、解卡、读取 DeepSeek Harness 会话的插件。给每个会话装上五个工具,让你能查看、诊断、恢复、指挥其他 Agent 会话。

这是什么

在 DeepSeek Harness 里,一个进程会同时挂着多个 Agent 会话。一个会话可能卡死——比如 cordis_inspect_query 之类的 Client 平台查询永远等不到页面响应,agent 停在 running 状态,后续消息全部积压在 inbox 不被处理。本插件提供:

  • 列出所有会话:标题、id、在线状态、agent 运行状态(running/idle)、排队消息数、工作目录;
  • 读取任意会话的对话记录:用户与助手消息按时间顺序返回,附带标题与 live 状态;
  • 诊断会话是否卡死:查看 agent 是否在线、running/idle、inbox 排队数、最后事件;
  • 解卡卡死的会话:对 running 的 agent 发送取消信号(keepInbox: true),中止卡住的活动但保留 inbox 排队消息,agent 回到 idle 后自动处理排队消息;
  • 向其他会话发送消息:目标在线直接投递;仅持久化时自动恢复后投递。

典型场景:发现另一个会话卡住不动 → 诊断确认 → 解卡恢复 → 查看它后续的进展 → 必要时发消息指挥它继续。

功能

能力 说明
list_sessions 列出所有会话:id、标题、工作目录、持久化状态、agent 运行状态、排队消息数
read_session 读取指定会话的对话记录(用户/助手文本消息),按序返回,支持 limit
session_status 诊断目标会话:是否在线、running/idle、inbox 排队数、最后事件
session_recover 解卡:对卡死的 running agent 发取消信号(keepInbox: true),中止卡住的活动、保留排队消息
send_session_message 向目标会话发消息:在线直接投递;仅持久化自动恢复后投递

安装

方式一:一行命令

dsh plugin --profile web add dsh-session-doctor

方式二:从 GitHub 安装

dsh plugin --profile web add github:mayf3/dsh-session-doctor

方式三:直接发给你的 Agent

打开任意一个 DSH 会话,把下面这句话发给它:

帮我安装会话医生插件,执行:dsh plugin --profile web add dsh-session-doctor

装完自动挂载,所有会话立即获得上述五个工具。

使用

  1. 对会话 A 说「列出所有会话」——它调 list_sessions,你可以看到每个会话的标题和运行状态;
  2. 怀疑某个会话卡住 → 说「检查会话 <id> 的状态」——它调 session_status,返回 status: running 且长时间无进展即确认卡死;
  3. 说「解卡会话 <id>」——它调 session_recover,卡住的活动被中止,排队消息在 agent 回到 idle 后继续处理;
  4. 说「看看会话 <id> 最近在做什么」——它调 read_session,返回该会话的对话记录;
  5. 说「给会话 <id> 发消息:……」——它调 send_session_message,对方在线立即送达、离线自动恢复后投递。

原理

  • 诊断:sessionQuery.listSessions() 列出完整逻辑语料,ctx.agents.get(id) 读取 live agent 的 status 与 inbox 排队数,sessionQuery.listEvents(id) 取最后事件作为进展证据;
  • 解卡:live agent 若 status === 'running',调用 agent.cancel({ kind: 'user' }, { keepInbox: true }) —— 中止当前卡住的活动,但保留 inbox 排队消息;agent 收敛到 idle 后,排队消息会被自动处理;
  • 读取:sessionQuery.readSession(id) 重放完整会话日志,提取 user/message 与 assistant/message 的文本块;
  • 发送:在线 → agents.get(id) 后 followup();离线 → agentLoop.resume() 恢复会话再投递。

与 dsh-agent-message 的关系

dsh-agent-message 专注跨会话消息收发(五种投递模式、回执、会话导航);本插件专注会话健康(诊断、解卡、读取记录),并提供一个简单的消息投递入口。两者可以共存:消息收发用 agent-message,卡住了解卡用 session-doctor。

目录结构

dsh-session-doctor/
├── lib/
│   └── index.js      # host 半区:五个工具
├── cordis.patch.yml  # 自注册补丁(dsh.bundle.patch 指向它)
├── package.json      # DSH 插件清单(dsh.bundle / dshx.contributes)
├── README.md         # 中文文档
└── README.en.md      # English documentation

限制

  • session_recover 只作用于 live agent(running 状态);离线会话不存在卡住的活动,无需解卡。
  • send_session_message 的离线恢复以默认模型启动目标会话(不继承它上次手动切换的模型选择)。
  • 跨进程/跨机器通信不在本插件范围内。

License

MIT

← 上一个 Prev claude2dsh 下一个 Next dsh-gbc-ui →