Preface¶
When troubleshooting Java production issues in DeepSeek Harness (DSH), the model often receives artifacts already exported by operations personnel, such as jstack, GC logs, dependency:tree, exception stack traces, or two Spring configuration files. The common practice is to ask the model to run jcmd or attach to the live process, or to manually “eyeball” deadlock cycles and dependency conflicts within long texts. The former is often blocked by permissions and auditing in production environments, while the latter is non-reproducible and prone to mistaking “failure to understand the input” for “no exceptions.” This article introduces dsh-jvm-doctor, a workflow plugin released by maintainer ax2. It performs only offline, deterministic text parsing, registering 5 tools to the model to transform pasted content into structured results, accompanied by parsing coverage and byte receipts.
What is this¶
dsh-jvm-doctor is a DSH plugin (npm package name dsh-jvm-doctor) positioned as an offline, deterministic JVM production report diagnostician. It does not touch the running JVM: no jcmd / jstack / jmap / jstat, no attach / JMX, no network, no file reading, no clock or random number usage; the same input always yields the same output.
The plugin has been verified on DSH 0.2.0-rc.2. It requires Node ≥ 20.10 to run (≥ 22.6 for testing) and is licensed under MIT. Community directory page: https://www.skillhub.cn/plugins/ax2/dsh-jvm-doctor; Source code and documentation: https://github.com/ax2/dsh-jvm-doctor.
Core Functions: Five Tools¶
Once installed, the model can call the following tools (names can be prefixed or filtered via only in the configuration):
| Tool | Function |
|---|---|
java_thread_dump |
Parses jstack or jcmd <pid> Thread.print: thread census, status histograms, daemon count, locks and top frames, Java-level deadlock cycles (waiting_for / holding chains), Object.wait/park counts, lock contention queues |
java_gc_log |
Parses JEP 158 unified GC logs and legacy formats from before JDK 9: pause statistics, p50/p90/p99, Young/Full splitting, heap intervals, cause histograms, promotion failures; estimates allocation rates when timestamps are available |
java_dependency_conflicts |
Parses Maven dependency:tree -Dverbose and Gradle dependencies / dependencyInsight: multiple versions of the same artifact, omitted for conflict with, omitted for duplicate, edge depths and summaries |
java_stack_trace |
Parses exception chains: type and message, stack frames, Caused by: / Suppressed:, ... N more reconstruction based on outer traces, deepest business frames, and up to 6 possible cause hints (structured facts, no causal inference) |
spring_config_diff |
Flattens two application.yml / .properties files into dot-notation keys to compare additions/removals/changes; sensitive values are replaced with *** before entering the payload |
The README emphasizes that tasks such as deadlock cycles, GC percentiles, dependency conflict resolution, and stack reconstruction involve significant volume and are error-prone if the model writes scripts each time. This plugin provides a fixed implementation supported by 47 tests.
Design Contract: Receipts and Boundaries¶
Every call returns a unified shape: result is the tool payload, and meta contains bytesIn, bytesOut, truncated, and notes. Footers are appended only when truncation occurs or explanations are needed, avoiding extra token consumption for clean calls.
Parsing quality is not conflated with “no issues”: each tool provides unknown_lines, unknown_samples, coverage, and confidence. When budgets are exceeded, items like threads_omitted or causes_omitted are reported individually rather than silently discarded.
Input exceeding maxInputBytes will throw an error and reject (no partial processing); output exceeding maxOutputBytes is truncated by code points and marked. Unrecognized syntax is counted in unknown_lines and lowers confidence.
Installation and Activation¶
Installation via npm to the web profile is recommended:
dsh plugin --profile web add dsh-jvm-doctor
Alternatively, use the pre-built tarball from GitHub Releases (same artifact as npm):
dsh plugin --profile web add https://github.com/ax2/dsh-jvm-doctor/releases/latest/download/dsh-jvm-doctor.tgz
To pin a version, replace latest/download/dsh-jvm-doctor.tgz in the URL with download/v<version>/dsh-jvm-doctor-<version>.tgz.
Restart the DSH application after installation. If you wish to install ax2’s deterministic-tools, py-doctor, win-native, and this plugin together, you can use dsh-toolbox-bundle, but do not mix it with standalone installations. Family overview entry: https://zicode.com/software/.
Configuration (Optional)¶
apply(ctx, config) accepts optional fields; invalid values fall back to defaults. Common options include:
maxInputBytes(default 2097152): UTF-8 byte limit for a single pasted text; rejects if exceeded.maxOutputBytes(default 262144): Soft limit for rendered text.maxThreads,maxGcEvents,maxConflicts,maxExceptions, etc.: List and sample budgets for each tool.toolPrefix: Prefix for tool names, e.g.,jvmresults injvm__java_thread_dump.only: Registers only specified tools; an empty array means all.
For the full field table, see the “Configuration” section in the GitHub README.
Typical Usage¶
- After installing and restarting DSH, provide the model with existing texts from the production environment in the conversation (thread dumps, GC logs, dependency trees, exception stacks, or two configuration files).
- The model calls the corresponding tools as needed. For example, after pasting an exception stack and calling
java_stack_trace, a structured summary similar to the following is obtained (excerpt from README test cases):
root_cause: java.lang.IllegalStateException: inner
primary: java.lang.RuntimeException: boom
frames: com.acme.Main.main(Main.java:7) coverage: 100% (3/3, parser 1)
- In thread dump scenarios,
java_thread_dumpoutputs fields likedeadlock_cycles, organizing the Java-level deadlocks reported by the JVM intowaiting_for/holdingchains, eliminating the need to manually search through hundreds of threads.
For local development without installing the package, run pnpm install && pnpm build in the repository and start via cordis.local-overlay.yml to mount the artifacts; see the local development section in the README “Installation” for details.
Use Cases and Notes¶
Suitable for: SREs, backend developers, and agent workflow authors who already have offline evidence and need to quickly obtain reproducible, auditable structured facts within DSH conversations. Compared to “letting the model write its own parsing scripts,” the behavior is fixed and covered by tests.
Not suitable for: Those expecting the plugin to collect threads or GC for you—this plugin never connects to running processes. Collection must still be done outside the container or within a compliant process, followed by pasting the text into the Harness.
Security and Trust: The plugin runs with the permissions of the current DSH process. Before installation, please read the source code and MIT license in the GitHub repository to ensure compliance with your requirements. Community directories such as SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-jvm-doctor converges the five most common types of text in JVM production troubleshooting (thread dumps, GC logs, dependency trees, exception stacks, Spring config diffs) into a unified “structured results + coverage receipts” contract, making it suitable for embedding into the DSH “everything is a plugin” workflow. For further information, visit the directory page skillhub.cn/plugins/ax2/dsh-jvm-doctor and github.com/ax2/dsh-jvm-doctor.