DSH Hub

heiheiha798/dsh-plugin-subagent-delete

dsh-plugin-subagent-delete

UIWorkflow0 GitHub stars· updated 2026-08-21

DSH plugin: delete_subagent tool + UI - release or permanently remove subagent sessions from the DeepSeek Harness web UI

Install

npx @deepseek-ai/dsh plugin --profile web add github:heiheiha798/dsh-plugin-subagent-delete

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

dsh-plugin-subagent-delete DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/dsh-plugin-subagent-delete.svg)](https://dshhub.dev/plugins/dsh-plugin-subagent-delete)

Paste this into your README. The star count updates with every catalog sync.

From the README

Excerpt from heiheiha798/dsh-plugin-subagent-delete, cleaned of badges and images.

dsh-plugin-subagent-delete

DeepSeek Harness (DSH) plugin that adds the missing subagent lifecycle interface:

  • delete_subagent — permanently delete a subagent session and take it out of the web UI list
  • release_subagent — stop / release a subagent without deleting its transcript
  • list_subagents — list the calling session's descendant subagents (including finished one-shot subagents)

Compatible with DSH 0.1.0-rc.8.

Why

DSH's built-in subagent control surface only provides send_message, interrupt_agent and list_agents. There is no delete/release endpoint, so finished one-shot and stale continuable subagents keep accumulating in the web UI list. This plugin fills that gap with an ownership-checked, model-callable tool plus optional HTTP routes.

Install

dsh plugin --profile web add github:heiheiha798/dsh-plugin-subagent-delete
# or pin to the published release
dsh plugin --profile web add github:heiheiha798/dsh-plugin-subagent-delete#v0.2.0
# or from a local checkout
dsh plugin --profile web add /path/to/dsh-plugin-subagent-delete

Restart the profile, then start a new session. The session gains three tools.

Tools

list_subagents

list_subagents({})                      // all descendants
list_subagents({ activity: "running" }) // running only
list_subagents({ mode: "one-shot" })    // one-shot only

Returns the caller's descendant subagent tree: id, label, mode (one-shot | continuable), activity (running | inactive), depth, parentId and hasChildren.

delete_subagent

delete_subagent({ subagent_id: "0fcfbdd6-5d21-46a4-bd95-2ca6edac1261" })
delete_subagent({ subagent_id: "<id>", recursive: true })

Permanently removes the subagent:

  1. verifies the target is a descendant of the calling agent's session (descendant discovery uses the official ctx.subagents.listDescendants);
  2. stops the live agent / drains a resident continuable Activation;
  3. flushes and detaches the live session from ctx.sessions;
  4. removes the on-disk session log directory (both uuid spellings);
  5. removes the session_projcache row;
  6. removes the id from workspace accounting and the archive set.

Without recursive: true a target that still has descendants is refused with has-descendants. Deletion is child-first and permanent.

release_subagent

release_subagent({ subagent_id: "<id>" })
release_subagent({ subagent_id: "<id>", recursive: true })

Stops the current turn and releases a resident continuable Activation via ctx.subagents.drainContinuableChildren, but keeps the durable transcript. The subagent remains resumable with send_message.

Web UI auto-refresh

DSH has an official refresh path for subagent creation (session/createdhost/session-added) but no symmetric contract for deletion: for a durable subagent, host/session-removed is treated by the client as a status change (running: false) only, so the sidebar list and subagent catalog are not refreshed.

Related plugins