Introduction

In the DeepSeek Harness (DSH) development workflow, errors are often swallowed at runtime or it is difficult to trace the specific relationship between user input and AI actions. Troubleshooting usually requires manually inspecting log systems, which is inefficient. The dsh-error-audit plugin solves this problem by archiving context information from errors and warnings in real time, and gives the AI the ability to read and respond on its own.

What Is This?

dsh-error-audit is a real-time AI self-audit plugin for DeepSeek Harness. It captures the first occurrence of an error or warning and writes a timestamp, error code, session ID, original user message, AI action, and workspace information to the log directory, then proactively notifies the AI. The plugin also includes the read_error_logs tool, allowing the AI to read error logs at any time.

Core Features

  • Real-time logging: Listens to events such as agent/error, agent/request-error, and tools/result, and immediately writes to disk and prints when an error occurs.
  • Full attribution: Recorded data is not truncated and includes time, error code, session, workspace, original user message, and AI action.
  • Proactive notification: Error-level events inject a prompt into the affected session (supports injection while running and waking an idle session); warnings are only written to disk.
  • AI-readable: Includes the read_error_logs tool, supporting listing, filtering, and reading individual reports.

Installation and Enabling

  1. Run the installation command:
    dsh plugin --profile web add "github:166767/dsh-error-audit#main"
  1. After installation, restart the dsh web service:
    dsh web
  1. Verify that the installation took effect:
    dsh --profile web --dump-config | findstr error-audit

Typical Usage

After installation, the plugin works out of the box. Log files are written to the $DSH_HOME/error-audit/ directory. The AI can directly call the built-in tool to read them:
read_error_logs

Configuration (Optional)

To change the default behavior, override the configuration items in the corresponding configuration file. The path is $DSH_HOME/profiles/<name>/cordis.patch.yml.

Config Item Default Value Description
logDir $DSH_HOME/error-audit Log directory; the environment variable DSH_ERROR_AUDIT_DIR can also be used
notify true Whether to proactively notify the AI of error-level events
notifyMode auto Notification mode: auto / inject / followup
windowSize 50 Number of recent session events included with each error

Applicable Scenarios and Notes

  • Applicable scenarios: DSH developers or administrators who need to monitor agent runtime status in real time and quickly locate error context.
  • Notes: The plugin runs with the permissions of the current DSH process. Review the source code and license before installing.

Conclusion

By structuring error logs and giving the AI the ability to read them itself, this plugin lowers the barrier to troubleshooting. The project repository and directory are listed below.