Skip to main content

dsh-subagent-monitor

18Stars0Forks0Issues0Watchers

Provides a UI panel to monitor subagent activities and statuses within DeepSeek Harness, offering real-time visibility into agent operations.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
TypeScript
License
MIT
Branch
master
deepseek-harnessdsh-plugin

Install

cmdweb profile
$ dsh plugin --profile web add @leetoners/dsh-ui-subagent-monitor

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin Mombrane/dsh-subagent-monitor for me: review the repository at https://github.com/Mombrane/dsh-subagent-monitor first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

一句话定位

在 DSH Web 界面侧栏底部加入「子代理」入口,并在屏幕右上角常驻一块卡片面板,实时展示当前会话派生出的每一个子代理的运行状态、耗时和跳转入口。

核心能力

  • 在侧栏底部增加一个带运行中数量徽标的「子代理」按钮,点击或自动展开面板
  • 在屏幕右上角常驻卡片列表,每个子代理一行卡片,显示状态点、名称、运行模式、耗时
  • 区分七种运行状态:运行中(蓝色追逐动画+实时秒表)、完成(绿点+耗时)、失败(红点)、已打断、令牌上限、已拒绝(琥珀点),以及中性「已结束」用于历史回填
  • 实时刷新(每秒向节点半身拉取一次快照),刷新浏览器或重启服务后面板自动恢复
  • 面板标题左侧的拖动柄可移动面板,底部拖动柄可调整高度;位置跨会话保留,高度按会话分别记忆,双击复位
  • 点击卡片「打开对话」跳转到该子代理会话;在子代理会话内,面板提供「← 主会话」一键返回

技术实现

  • 语言: TypeScript
  • 关键依赖: @deepseek-ai/cordis(插件运行时)、@deepseek-ai/dsh-client-runtime(客户端上下文)、@deepseek-ai/dsh-subagent(子代理事件源)、react(UI 渲染)
  • 架构模式: 双半身结构。Node 半身(src/index.ts)以全局模式监听 subagent/start 与 subagent/end 事件、把每个 run 沿父会话链归因到根会话,再注册 GET /api/subagent-monitor/snapshot 回环路由供浏览器拉取;Browser 半身(src/client/index.ts)通过 Cordis slots 在 sidebar.footer.action 注册「子代理」入口、在 shell.overlay 注册常驻面板,使用 1 秒轮询 + useSyncExternalStore 驱动重渲染
  • 入口文件: src/index.ts(Node 半身)、src/client/index.ts(Browser 半身)、src/client/panel.tsx(面板与触发器组件)

适用场景

想让 DSH Web 用户一眼看清「我的 Agent 现在派了哪些子代理、各自跑到哪一步」的场合——尤其是当 Agent 在主会话中频繁派生长任务(一句话文件统计、代码搜索、连续对话等)时,无需进入每个子代理会话就能从面板实时观察进度、看清耗时、跳转到关心的子任务。

前置依赖与兼容性

依赖最低版本说明
DSH (Cordis 组合)>= 0.1.0-rc.0需宿主为 DSH Web 组合;peerDependencies 声明 cordis >= 0.1.0
@deepseek-ai/dsh-client-runtime>= 0.1.0-rc.0浏览器半身的客户端运行时
@deepseek-ai/dsh-session>= 0.1.0-rc.0提供 sessions 服务,用于「打开对话」跳转
@deepseek-ai/dsh-subagent>= 0.1.0-rc.0子代理事件源(start/end)
@deepseek-ai/dsh-host-webserver>= 0.1.0-rc.0节点半身挂载 HTTP 路由所需的 Web 服务
@deepseek-ai/dsh-client-ui-layout / -sidebar / -slots>= 0.1.0-rc.0浏览器 UI 框架(侧栏、布局、slot 注册)
React^18.2.0面板 UI 渲染(dependencies)
平台跨平台仅依赖 DSH Web 平台(package.json dsh.client.platform=web),不限操作系统
Node未声明源码中未显式声明 engines.node

安装方式

dsh plugin --profile web add github:Mombrane/dsh-subagent-monitor

配置项

本插件无需额外配置。源码中未声明任何 Schema/Config/env 配置项;面板布局(位置、高度)通过用户拖动后由 localStorage 自动记忆。

常见问题

Q: 刷新页面后面板会消失吗?

A: 不会。面板是组合中的常驻行,每次页面加载都会自动恢复,由 Browser 半身每秒轮询 Node 半身 GET /api/subagent-monitor/snapshot 拉取快照。

Q: 「完成」和「已结束」这两种状态有什么区别?

A: 「完成」是面板在本次生命周期内实时观测到的成功结局(绿色状态点 + 耗时);「已结束」是服务重启前创建的子代理历史回填行,因为没有观测到结局事件,归类为中性灰色状态点,结局未知。

Q: 面板最多能保留多少条记录?

A: 每个根会话最多保留 200 条记录(src/index.ts 中的 MAX_PER_ROOT),超出后按最旧的已结束行淘汰,运行中的不会被淘汰。

Q: 面板位置和高度会被记住吗?跨会话共享还是按会话隔离?

A: 都会记住,但策略不同:位置写入全局 dsh-smn.panel-position.v1 单键,所有会话共用同一位置;高度写入 dsh-smn.panel-height.v2.<sessionId>,按会话分别记忆,切换会话互不影响。刷新页面或重启浏览器后恢复;双击对应拖动柄可复位。

Q: 这个面板的安全边界是怎样的?可以暴露在公网吗?

A: 轮询路由 GET /api/subagent-monitor/snapshot 直接挂在 DSH Web 服务端口下、面向回环地址、无鉴权。仅建议本地或内网环境使用;如果必须对外暴露,应在网关层对该路径做访问控制。

Q: 子代理卡片能直接跳到对话吗?怎么从子代理会话返回?

A: 卡片右侧有「打开对话」按钮,点击会调用宿主会话服务打开该子代理会话;进入子代理会话后面板头部会出现「← 主会话」按钮,一键返回上一级。

Q: 移动端能用吗?

A: 视口 ≤768px 时面板默认不弹出(避免遮挡移动屏幕),但侧栏「子代理」入口仍保留,可手动点击展开。

Q: 怎么卸载?

A: 运行 dsh plugin --profile web remove github:Mombrane/dsh-subagent-monitor,然后重启 dsh web 即可彻底移除该组合行。

上手难度

入门 — 安装即用、不需要任何配置项,权限在普通用户层面(侧栏入口 + 右上角面板 + 拖动/缩放)就够。

已知问题与限制

  • 轮询路由 /api/subagent-monitor/snapshot 面向回环地址、无鉴权,仅适合本地或内网使用,公网部署存在被同网段用户枚举子代理信息的风险(README.md:113 与 src/index.ts:165-177 注册的 webServer.register 暴露的 handler)
  • 轮询间隔固定为 1 秒,不可配置;高密度子代理场景下浏览器每秒都会发起同源请求(src/client/panel.tsx:315-322)
  • 浏览器面板对历史回填行无法补齐结局事件,归类为「已结束」中性状态,与真实状态可能不一致(src/index.ts:148-149 与 src/client/panel.tsx:96)
  • Node 半身对超过 MAX_PER_ROOT(200)的已结束行做淘汰,运行中的行不会被淘汰;长时间跑大量短任务后历史会被截断(src/index.ts:67-82)
  • 拖动位置/高度时跨会话保留策略对部分用户可能是「反直觉」行为(位置共享、高度隔离),需要双击拖动柄才能复位到默认(src/client/panel.tsx:432-437, 464-468)

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/Mombrane/dsh-subagent-monitor)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory