Introduction¶
DeepSeek Harness (DSH) adopts a plugin-based architecture and uses extension points to enhance functionality. When developing agents or debugging workflows, developers often need to pay attention to the duration distribution of tool calls, error types, and overall success rates.
dsh-local-diagnostics is a local in-memory diagnostics plugin designed specifically for DSH. It observes runtime state through the publicly exposed Cordis extension points of Harness, without modifying the Agent Loop. Compared with general-purpose logging solutions that require collecting large amounts of prompts and intermediate state, this plugin focuses on performance metrics and structured error codes, while strictly following a privacy-first principle.
Plugin Positioning¶
- Name: dsh-local-diagnostics
- Maintainer: fengyufengzi
- Category: admin-security
- License: MIT
- Core value: Privacy-first in-memory diagnostics for observing the runtime state of DeepSeek Harness.
Core Features¶
The plugin collects data through the following extension points. It does not write to disk and does not send network requests:
- Performance measurement: Measures dispatch duration at the
tools/executestage and always callsnext(), ensuring that the diagnostics process does not affect main-flow execution. - State statistics: Aggregates final success and failure cases, as well as structured error codes, at the
tools/resultstage. - Event monitoring: Counts only event types at the
session/eventstage. - Error classification: Counts only error class names at the
agent/errorstage. - Report generation: Returns a sanitized aggregate report for the current Session through the
diagnostics_reportinterface.
Privacy Guarantees¶
The plugin is designed to exclude collection of sensitive information, ensuring that the debugging process does not leak data:
- Not collected: prompts, messages, tool parameters, tool outputs, error messages, Session IDs, file paths, or credentials.
Environment and Installation¶
Before installing, ensure that your environment meets the following requirements:
- Node.js
^22.19.0 || >=24.0.0 - pnpm
11.7.0 - DeepSeek Harness
0.1.0-rc.6series
Follow these installation steps:
- Build and install the plugin into the DSH profile:
corepack pnpm run build
npx @deepseek-ai/dsh plugin --profile web add .
- Configure the plugin (add to the Harness configuration file):
- insert:
- id: local-diagnostics
name: dsh-local-diagnostics
config:
maxDistinctValues: 128
Typical Usage¶
- Trigger a report: In a conversation, ask the Agent to call
diagnostics_report, and you can then view the sanitized aggregate diagnostic information in the console or logs. - Remove the plugin: To uninstall it, run the following command:
npx @deepseek-ai/dsh plugin --profile web remove dsh-local-diagnostics
Notes¶
- Data lifecycle: Statistics cover only the process lifetime after the plugin is loaded. A restart or plugin hot reload will clear the statistics.
- Measurement scope: The
timingmetric includes only the dispatch-stage duration and does not include approval or result-rendering stages. - Current limitations: The first version has no UI, file export, OpenTelemetry integration, or cross-process aggregation capability.
- API stability: Harness is still in developer preview. The plugin API may undergo breaking changes, so it is recommended to watch for source-code updates.
Summary¶
dsh-local-diagnostics provides a lightweight, network-free debugging method, making it suitable for quickly diagnosing tool-call performance and error types in a local development environment. Developers can obtain structured runtime feedback without leaking sensitive business data. For more details, refer to the GitHub repository.