Introduction

DeepSeek Harness (DSH) uses a plugin-based architecture and allows custom logic to be injected through configuration. During agent development or debugging, when an Agent invokes tools such as edit or write to modify code, the changes are usually scattered across the file system and are difficult to track in real time within the conversation flow. The dsh-diffstream plugin directly displays these code changes in the DSH Web GUI conversation flow, converting file-level changes into visualized line-level diffs.

Plugin Overview

dsh-diffstream is a DSH Web plugin maintained by F-Light. It takes over tool card rendering and end-of-turn processing to embed code changes directly into the conversation flow, without modifying DSH source code.

Core Features

The plugin provides the following capabilities:

  1. Line-Level Diff Embedded in Tool Cards
    After each edit or write tool execution completes, the changes are rendered directly inside the corresponding tool card. Added lines are marked with a green +, removed lines with a red −, and line numbers and context are included.

  2. Streaming Animation Display
    The diff expands with a streaming line-by-line animation, with speed controls for 1x, 2x, or immediate display. The animation is synchronized with the streaming output of assistant messages; the revealed line indicates how far execution has progressed.

  3. End-of-Turn Change Summary
    At the end of each completed turn, a “📋 Change Summary for This Turn” card is appended. The card contains a file-level list, displaying the path, add/remove status labels, and +N −M statistics. Clicking a file row expands the full line-level diff for that file. Multiple edits to the same file are automatically merged in the statistics.

  4. Git-First with Fallback Mechanism
    The summary card prefers real git diff output (including context hunks, obtained via Host RPC). If the project is not a Git repository or the Git command fails, it silently falls back to a tool-parameter-based diff, ensuring the feature remains uninterrupted.

  5. Performance and Interaction Optimizations

    • Pure Client-Side Computation: Uses a pure client-side LCS line-level comparison algorithm with zero dependencies, zero latency, and no disk reads.
    • Large File Truncation: Files longer than 200 lines are automatically truncated, with an option to click and expand the full content.
    • Auto-Scrolling: During animation playback, the view automatically follows the latest line to the bottom; manual upward scrolling pauses the follow behavior.
    • Deduplication: Animations are deduplicated by tool call callId. Historical turns (after refresh) are displayed in full directly, without replaying the animation.

Installation and Enablement

The plugin is provided as a standalone npm package and injected through the profile’s cordis.patch.yml.

# 1. 进入 web profile 目录
cd ~/.dsh/profiles/web

# 2. 安装插件包
pnpm add @f-light/dsh-diffstream
# 3. 编辑 cordis.patch.yml,追加插件配置
- insert:
    - id: diffstream
      name: '@f-light/dsh-diffstream'
# 4. 重启 dsh web 使配置生效
dsh --profile web

Usage Instructions

After installation and restart, the plugin automatically takes effect in the conversation flow.

  • View Changes: After each tool execution, an inline diff view appears immediately in the tool card.
  • Interactive Operations: Click a file row in the end-of-turn summary card to expand the full diff for that file.
  • Non-Git Projects: Even if the current directory is not a Git repository, the plugin can still display a diff by comparing tool parameters as long as old_string or content is provided.
  • File Output Conflicts: For turns with no file output, the plugin defers to the official ProducedFiles, and the two do not interfere with each other.

Notes

  • The plugin runs with the permissions of the current DSH process. Inspect the source code and license before installation.
  • The plugin does not produce new file output; it only changes the presentation-layer logic of the Web GUI.
  • Because it uses pure client-side computation, the performance overhead is minimal and will not affect the overall speed of conversation generation.

References