In daily development with DeepSeek Harness (DSH), task failures are normal. When facing Agent errors, developers need to quickly identify the cause, obtain evidence, and determine safe next actions. Reading raw logs directly is often verbose and may contain sensitive data, which reduces troubleshooting efficiency.

dsh-postmortem is designed to solve the problems above. It reads existing DSH session events and generates a redacted recovery plan in seconds. As a local-first, read-only plugin, it provides basic postmortem capabilities without depending on a model.

Core Capabilities

This plugin focuses on providing actionable fault analysis and recovery recommendations.

  • Generate redacted recovery plans: It answers three core questions—where it failed, what the evidence is, and what to check before the next attempt. The output does not include user messages, tool parameters, outputs, files, prompts, credentials, or raw trajectories.
  • Local-first and read-only: All analysis is based on existing local Session events, does not claim task success, and relies entirely on the project’s existing validators to determine task status.
  • Intelligent fault detection: It can distinguish termination states from causal evidence, and distinguish Agent completion text from task success; detect repeated failures (such as three or more unchanged failed calls); identify and report user cancellations.

Installation and Configuration

Install the plugin to the specified DSH profile, and the system automatically registers its bundle layer. After installation, restart the profile to use relevant commands after a failure.

dsh plugin --profile <profile-name> add @huichangzz/dsh-postmortem

To enable the optional model postmortem layer (for more complex analysis), add configuration overrides in cordis.patch.yml. The model layer reuses the llm service already configured in DSH; if the model is unavailable, the deterministic report remains available.

- id: postmortem
  config:
    model:
      enabled: true
      provider: your-provider
      model: your-model
      timeoutMs: 10000

Typical Usage

After installation and restarting the profile, you can perform postmortems with the following commands:

  1. View failure details and evidence: Run /postmortem. It lists the issues found, distinguishes real-time status of open turns from finished turns, and provides pre-retry check recommendations.
  2. Get a concise recovery path: Run /postmortem-next. It displays the main issue, the first validation step, and a safe next command. It does not treat Agent completion text as task success.
  3. Create a new recovery session: Run /postmortem-recover. It explicitly creates a new DSH agent with a parent session relationship based on a redacted handoff, and never injects the failed transcript into the new session.
  4. Export JSON recommendations for external use: Run /postmortem-plan. It exports schema-v1 format action recommendations, including evidence categories, recommended actions, and validation steps, for copying only; this package does not execute these actions.

Compatibility and Notes

  • Compatibility: Target-compatible with DSH 0.1.1-rc.2 and Cordis 4.0.1. The plugin uses the public session event vocabulary as its compatibility boundary.
  • Headless mode: Headless collectors may affect tool/call fields.
  • Configuration and security: The plugin does not configure or store any secrets. autoOnFailure defaults to detected, meaning it only prints actionable detected faults.

dsh-postmortem transforms complex failure logs into structured, redacted recovery guides, helping developers shift from “looking at logs” to “solving problems.” For more details and source code, refer to the project homepage.