Introduction

In the development of DeepSeek Harness (DSH), agents often cannot reuse previous diagnostic results after encountering errors, leading to repeated reasoning and token waste. The dsh-errkb plugin aims to solve this problem. It converts errors encountered by the model into a numbered, editable knowledge base, and when an error recurs, it injects the recorded fix into the context so that the model can directly use the known solution.

Plugin Positioning

  • Core Value: Error recycling. The same failure only needs to be diagnosed once, recorded, and returned directly as a known fix when it reappears.
  • Maintainer: jingchangzhao-gif
  • Category: Memory

Current Status

The plugin is currently in a P5 complete state.
* Completed: Design document completed and core logic implemented (T01-T15). This includes knowledge base index parsing, error fingerprinting, mandatory data masking, error storage, capture-layer hooks, injection-layer hooks, and five agent tools.
* Pending: Capture of LLM request failures (T16), automatic installation into the configuration file (T17), and publishing to npm (T18).

Core Features

  1. Error recycling and recording: Records tool failures, non-zero command exits, and turn-level errors to ERRORS.md.
  2. Automatic injection: When a repeated error is detected, injects the recorded fix before the model rediagnoses it.
  3. Mandatory data masking: Masks sensitive information to ensure privacy and security.
  4. Toolset: Provides five tools: err_lookup (lookup), err_record (record), err_list (list), err_forget (forget), and err_stats (statistics).

Usage

  1. Prerequisites:

    • Node.js version must be >= 22.13
    • pnpm version must be 11.7.0
  2. Load the plugin:
    Since no automatic installation command is provided, you need to manually add the plugin to the DeepSeek Harness configuration file. After loading, the plugin automatically records errors to ERRORS.md.

  3. Tool interactions:

    • Automatic flow: After loading, the plugin monitors tool failures and command exit codes. When an error recurs, the system automatically injects the fix.
    • Manual recording: If an error is not automatically recorded or requires manual supplementation, use the err_record tool.
    • Querying and management: Use err_lookup to find a specific error, err_list to view all errors, err_forget to delete records, and err_stats to view statistics.

Knowledge Base Format

Error information is stored in Markdown format in the ERRORS.md file. Mandatory data masking rules are applied on every write.

Notes

  • Permissions: The plugin runs with the permissions of the current DSH process. Review the source code and license before installing.
  • Limitations: It currently does not support automatically capturing LLM request failures and requires manual addition to the configuration file.
  • Privacy: Mandatory data masking is supported, and all sensitive information is processed before storage.

Summary

dsh-errkb provides DSH developers with infrastructure to turn errors into assets. By building a numbered error knowledge base, it reduces the cost of repeated reasoning. Although manual configuration is currently required, its core capture and injection mechanisms already have practical value.