Introduction¶
One of the core capabilities of DeepSeek Harness (DSH) is projection, which is used to observe session state. The existing sessionStats provides basic counts, but it is difficult to directly answer the question, “Is the current session healthy?” The dsh-session-insight plugin supplements key metrics such as steps, tool calls, failure count, repeat count, and failure rate via a read-only session health status bar. It exists as a sessionInsight projection unit and is displayed as a card above the input box.
Core Features¶
This plugin focuses on real-time health monitoring of the session and possesses the following capabilities:
-
Health Status Bar
Displays a set of read-only data above the input box: steps, tool calls, failures, repeat calls, and failure rate. -
Projection Unit Implementation
Implements thesessionInsightprojection unit, passing calculation results to the client viawire.view. -
Event Collapsing
Collapsing the following events internally to avoid sending unnecessary changes to the client:assistant/message: Extracts tool call information.tool/call: Records dispatched calls.tool/result: Records results and error status.step/endandturn/end: Session cycle termination events.
-
Failure Rate Calculation
- Formula: Failure Rate = Number of failed
tool/resultevents ÷ Number of dispatchedtool/callevents. - Boundary: Calls intercepted by
ctx.tools.guard()are not counted in the denominator or the numerator, reflecting the health status of “dispatched calls.”
- Formula: Failure Rate = Number of failed
-
Display Precision Strategy
Dynamically adjusts the display format based on the sample size to avoid over-interpretation of small samples:- Sample Size < 10: Displays raw scores (e.g.,
1/3,0/5), preserving precision and sample size information. - Sample Size ≥ 10: Displays percentages (e.g.,
8.6%), reducing digits for readability. - Sample Size = 0: Displays a dash (
—).
- Sample Size < 10: Displays raw scores (e.g.,
Installation and Activation¶
The plugin is released via GitHub repository and does not support the npm channel.
Web Profile¶
The Web Profile supports the standard CLI installation method:
& $dsh plugin --profile web add github:Elari39/dsh-session-insight
After installation, you need to add "dsh-session-insight" to the dsh.profile.bundles array in ~/.dsh/profiles/web/package.json and then restart DSH.
Desktop Profile¶
The Desktop Profile is exclusive to Electron and cannot use the dsh plugin command. You need to run the installation script provided with the plugin:
pwsh -File .\install.ps1
Verifying Loading¶
After restarting the application, the health status bar should appear above the input box. You can also request the load directly via the browser to test:
/plugins/??dsh-session-insight/client.js&rev=<rev>
If it returns 200, the browser-side loading was successful; a 404 usually implies the Host-side was not mounted correctly.
Notes¶
- Desktop Profile Limitation: The Desktop Profile must be installed via
install.ps1and cannot use thedsh plugincommand. - Process Exit: You must completely exit the Electron application before any plugin installation or configuration modification operations.
- Production Environment: It is recommended to pin to a fixed version (using a tarball URL) to avoid incompatibilities caused by subsequent updates.
- Dependency Limitation: The client component only allows
require('react')and cannot import other first-party UI libraries, otherwise it may cause Slot crashes. The plugin returnsnullwhenuseProjectionis unavailable, ensuring safe degradation. - Release Status: Currently, this plugin is only released on GitHub; the npm channel has not been released yet.
Summary¶
dsh-session-insight provides a lightweight session health monitoring layer, separating calculation logic from the view via the projection mechanism, and optimizes display strategies for small sample scenarios. This is a practical auxiliary tool for developers who need to deeply analyze agent operation status.