Introduction

DSH plugins write events to session logs. Verified documentation indicates that dsh 0.1.0-rc.x lacks a third-party event type registration mechanism; when an external plugin writes an event like message-edit/version, restarting the service to recover the session may throw a SessionFormatUnsupportedError, preventing the session log from opening normally.

dsh-session-repair provides a tool for this issue: it first scans for unknown event types in zstd session logs, then fills in ignorable markers and rewrites the logs under controlled rules.

What is this

dsh-session-repair is a DeepSeek Harness plugin designed to fix session logs that fail to open due to unknown event types.

  • GitHub Repository: Equinox7379/dsh-session-repair
  • License: MIT
  • package.json declared version: 0.1.0
  • Applicable Problem: SessionFormatUnsupportedError caused by the lack of a third-party event type registration mechanism in dsh 0.1.0-rc.x

It primarily does two things: scan for unknown event types in logs; and after confirmation, repair non-live session logs and fill in ignorable markers for unknown events.

Core Features

Scanning Unknown Events

Using the action=scan of the session_repair tool only performs reporting and makes zero changes by default. Output fields include action, files, unknown, fixable, etc.

Example output:

{ "action": "scan",
  "files": [ { "file": "--E-surdet--/session-…/session.jsonl.zstd",
    "unknown": { "message-edit/version": { "count": 1, "ignorable": 0 } }, "fixable": true } ] }

Repairing Session Logs

  • action=repair: Repairs all non-live sessions.
  • action=repair_id: Repairs a specified session, supports sessionId parameter.

Reliability Constraints

  • Forces a backup as .before-ignorable before repair.
  • Does not process events that have already been marked repeatedly.
  • Maintains frame format compliance: The first frame must be a single header line, followed by one frame per line, compressed with a checksum.
  • Aborts the file and reports it if decompression fails or the first line is illegal; does not forcibly write back.

Runtime Boundaries

  • Zero runtime dependencies.
  • No custom session events.
  • No HTTP routes.
  • package.json declares dsh.bundle.patch as ./cordis.patch.yml.

Installation and Enabling

The installation command uses the local path format. Replace /path/to/dsh-session-repair with the plugin directory:

dsh plugin --profile web add link:/path/to/dsh-session-repair

After installation, dsh web needs to be restarted for the plugin configuration to take effect.

Typical Usage

Tool Name: session_repair

Parameters:

  • action
  • sessionId

Common Actions:

  1. Check only, do not modify: action=scan
  2. Repair all non-live sessions: action=repair
  3. Repair specified session: action=repair_id, passing in sessionId

scan output example:

{ "action": "scan",
  "files": [ { "file": "--E-surdet--/session-…/session.jsonl.zstd",
    "unknown": { "message-edit/version": { "count": 1, "ignorable": 0 } }, "fixable": true } ] }

Applicable Scenarios and Notes

Suitable for use in the following scenarios:

  • There are unknown event types written by third parties in the session logs.
  • Encountering SessionFormatUnsupportedError when restoring sessions in dsh 0.1.0-rc.x.
  • Wish to check read-only first, then decide whether to rewrite the logs.

Pre-use notes:

  • The plugin runs under the permissions of the current dsh process and operates on session log files; you should check the source code, ./cordis.patch.yml, and the MIT license before installation.
  • repair will rewrite session logs, but will first create a .before-ignorable backup.
  • repair only processes non-live session files; use repair_id with sessionId for specified sessions.
  • If decompression fails or the first line is illegal, the file will be aborted and reported, and will not be forcibly written back.

Conclusion

The value of dsh-session-repair lies in breaking down the problem of “session logs failing to open due to unknown events” into two steps: first scan to report, then controlled repair based on ignorable markers.

Currently verifiable information includes the MIT license, package.json version 0.1.0, and the repository address is:

https://github.com/Equinox7379/dsh-session-repair

The materials provided in this article have not confirmed the directory page URL; if you need the directory page entry, please refer to the verifiable DSH community directory.