DeepSeek Harness (DSH) adopts a plugin-based architecture, aiming to extend capabilities through modularization. When using agents for code development, developers need to clearly know which model, in which session, made modifications to which files. The dsh-git-ai plugin addresses this attribution need: it converts agent operation records into data recognizable by git-ai, enabling automatic tracing of code changes.

Plugin Role

dsh-git-ai is a plugin for DeepSeek Harness, maintained by developer NiuZhuang. It is categorized under “Memory” and is licensed under the MIT License. Its core function is to intercept DSH tool execution hooks, convert file edits, the model used, and session information into git-ai agent-v1 checkpoint payloads, and invoke the git-ai checkpoint command to record them.

Core Features

The plugin achieves attribution mainly by intercepting and transforming data:

  1. Interception-point listening: Intercepts the two DSH interception points tools/pre-execute and tools/post-execute.
  2. Data recording: Records file editing operations, the model name used, and session information.
  3. Protocol conversion: Converts captured tool calls into the payload format of the git-ai general interface agent-v1.
  4. Shell support: Supports recording pre/post shell checkpoints for bash and pwsh commands.
  5. Configurable options: Provides rich configuration options, including specifying the git-ai executable path, setting the agent name, specifying the model, checkpoint preset, call timeout, and whether to track bash commands.

Installation and Enablement

The plugin can be installed with the following command:

dsh plugin --profile web add dsh-git-ai

If using pnpm version 10 or later, add the -w parameter to the installation command to avoid workspace root conflicts:

dsh plugin --profile web add -w dsh-git-ai

The package declares dsh.bundle, so the configuration is automatically activated when the above command is run. If you need to load it manually or configure it in a custom profile, add the following block to cordis.patch.yml:

- dsh-git-ai:
    gitAiPath: git-ai
    agentName: deepseek-harness

Typical Usage

After installation and configuration, you can verify the functionality with the following steps:

  1. Install the plugin: Run the installation command.
  2. Configure the plugin: Add the configuration block above to cordis.patch.yml.
  3. Start Harness: Run dsh web to start the service.
  4. Edit a file: Have the agent edit a file in the git repository.
  5. Check status: Run git-ai status -- to see whether git-ai received the checkpoint data.
  6. Commit and verify: Run git add -A && git commit -m "test" to commit, then run git-ai stats HEAD --json to check attribution statistics.

Configuration Options

The plugin supports fine-grained control through a configuration object. The configuration options include:

import type { Config } from 'dsh-git-ai'

const config: Config = {
  gitAiPath: 'git-ai',                  // 可选:git-ai 可执行文件路径(省略时通过 PATH 解析)
  agentName: 'deepseek-harness',        // 可选:标记在所有检查点上的 agent_name
  model: '',                            // 可选:显式指定的模型,空则回退到 agent.options.model
  checkpointPreset: 'agent-v1',         // 可选:git-ai 的通用集成预设
  timeoutMs: 10_000,                    // 可选:git-ai 调用超时时间(毫秒)
  trackBash: true,                      // 可选:是否为 bash/pwsh 发送 pre/post shell 检查点
}

Applicable Scenarios and Notes

  • Dependencies: git-ai is an optional dependency. If git-ai is not installed, fails to invoke, or times out, the plugin only logs a warning and does not interrupt the tool call.
  • Edit attribution limitation: The file editing tool currently sends only post-edit checkpoints. This means that if the user already made uncommitted changes to the same file before the agent edited it, those changes may be incorrectly attributed to the agent.
  • Bash output limitation: Attribution for Bash output is snapshot-based; only file changes within the repository tree are attributed, and changes outside the repository cannot be tracked.
  • Synchronous latency: Each tracked tool call waits for the git-ai checkpoint to complete (bounded by timeoutMs) before returning the result, which increases the synchronous latency of tool calls.

Summary

dsh-git-ai provides DeepSeek Harness users with a standardized way to connect agent operations with git-ai’s attribution system. By intercepting tool execution hooks and generating payloads that conform to the agent-v1 specification, it helps developers achieve traceability of code provenance. For more details and source code, see its GitHub repository or community directory page.