Preface¶
When splitting tasks with sub-agents in DeepSeek Harness (DSH), the main session sidebar can show sub-agent entries, but the running count, status, and token usage often require switching into each sub-session to confirm. When the main session spawns multiple parallel sub-agents, there is a lack of a centralized, real-time, and drill-down monitoring interface.
Below is the community plugin dsh-subagent-monitor (maintained by Mombrane, MIT license). It adds a “Sub-agents” entry at the bottom of the DSH Web sidebar and maintains a draggable card panel in the top-right corner of the screen, displaying the real-time status of sub-agents directly spawned from the current session. When entering a sub-agent session, the panel dynamically updates to show the next layer of sub-agents directly spawned from that session.
What is This¶
dsh-subagent-monitor is a client-side extension plugin for DSH Web. The npm package name is @leetoners/dsh-ui-subagent-monitor, currently at version 0.3.0, requiring DSH platform version 0.1.x. The repository provides both dsh.client plugin and dsh.bundle combined bundle (including cordis.patch.yml and prebuilt lib/).
The plugin retrieves snapshots via polling /api/subagent-monitor/snapshot. This route is loopback-only and unauthenticated, recommended only for local or intranet use.
Core Features¶
Real-time Status and Card List¶
Each sub-agent is represented by a rounded card, displaying its name, spawn method, short ID, status, and elapsed time. “Open Conversation” is on the right side of the card, allowing navigation to the corresponding sub-session.
Supported statuses include:
| Status | Description |
|---|---|
| Running | Blue pixel-chasing animation (same as DSH sidebar’s active state) + real-time stopwatch |
| Completed | Successfully ended as observed in real-time by the panel, green dot + glow, displays elapsed time |
| Ended | Historical backfill from before service restart, outcome not observed |
| Failed | Ended with error, red dot + glow |
| Interrupted / Token Limit / Rejected | Aborted, reached token limit, or request rejected, amber dot + glow |
Overview Dashboard¶
At the top of the panel is a summary bar: on the left, three ring charts display the main session’s context window current usage, and the combined cache hit rate of the main session and sub-agents; on the right, a status bar chart shows the running / completed / abnormal counts of the current layer’s sub-agents (scaled proportionally to the maximum value). Below each card is a line of usage details: input / output tokens, cache hits, and context size for that run.
The main session’s “Context” ring shows the current window usage (projectedTokens: latest prompt sample + surface heuristic adjustments), rising with new content and immediately falling back after compression, rather than being a cumulative count that only increases with the session. Usage data comes from the TokenUsage reported by providers in each sub-agent session log (assistant/message events); if the adapter hasn’t reported, it displays “—”.
Layered Viewing and Navigation¶
The panel only shows sub-agents directly spawned from the current session, not flattened across layers. After entering a sub-agent session, you can continue viewing its directly spawned next layer; a “← Previous Layer” button appears in the panel, allowing navigation back to the direct parent session.
Panel Interactions¶
- Four-corner arrow handle on the left of the title: Moves the panel position, persists across sessions, double-click to reset.
- Bottom drag handle: Adjusts panel height, remembered per session, double-click to reset.
- Two-stage collapse: First “Collapse” only hides the sub-agent cards below, keeping the top overview dashboard; the button changes to “Collapse All”. Clicking again collapses to just the title bar; “Expand” restores the full panel in one step.
- Bottom provides “Clear Completed”; each direct parent session retains up to 200 records, with the oldest ended rows removed when exceeded.
- Panel automatically restores after page refresh or service restart (persistent combination).
- When viewport width ≤768px, the panel does not pop up by default; the sidebar button can still open it manually.
Installation and Enabling¶
Recommended installation via npm (published as v0.3.0, built and signed by GitHub Actions, SLSA provenance verifiable):
dsh plugin --profile <your-profile> add @leetoners/dsh-ui-subagent-monitor
Alternatively, install directly from GitHub:
dsh plugin --profile <your-profile> add github:Mombrane/dsh-subagent-monitor
If prompted to allow build scripts during the first GitHub installation, confirm as instructed in the profile’s pnpm-workspace.yaml.
After installation, restart dsh web to take effect. A “Sub-agents” entry appears at the bottom of the sidebar; clicking it opens the top-right monitoring panel.
Typical Usage¶
-
Spawn sub-agents in the main session (e.g.,
spawnorone-shot) without switching the current page. The top-right panel lists sub-agents directly spawned from the current session, with running items showing a stopwatch and token details. -
Click “Open Conversation” on a card to enter the sub-agent session. The panel switches to the next layer of sub-agents directly spawned from that sub-session; click “← Previous Layer” to return.
-
When spawning multiple sub-agents in parallel, quickly grasp overall progress via the top status bar chart and bottom “Running · Completed · Abnormal” counts; after tasks finish, use “Clear Completed” to tidy the list.
-
When focusing on context and cache, view the three ring charts at the top: the main session’s current window usage, cache hit rate, and each card’s input / output and context utilization.
Suitable Scenarios and Notes¶
For whom: Developers who frequently use sub-agents in DSH Web to explore codebases or split subtasks in parallel, and need a glanceable view of each sub-agent’s status and token usage from the main interface.
Before use:
- The plugin runs with the current
dshprocess permissions; review the source code and MIT license before installation. - The monitoring route
/api/subagent-monitor/snapshotis unauthenticated; do not expose it to the public internet. - Usage and cache data depend on provider adapter reporting; unadapted fields display “—” if not reported.
- “Completed” (real-time observation of success) and “Ended” (pre-restart history, unknown outcome) have different meanings, as noted in the status table above.
For secondary development, inline the repository’s src/ into the DSH source tree; see method C in the GitHub README. Design decisions and data flow are detailed in the repository’s ARCHITECTURE.md.
Links¶
- SkillHub directory page: https://www.skillhub.cn/plugins/Mombrane/dsh-subagent-monitor
- GitHub repository: https://github.com/Mombrane/dsh-subagent-monitor (approx. 18 stars, included in awesome-dsh-plugin)
dsh-subagent-monitor converges the runtime status of sub-agents from “checking each session individually” into a single draggable, drill-down real-time panel, suitable as a daily monitoring tool for DSH Web multi-sub-agent workflows.