When running DeepSeek Harness (DSH) on Windows, the default interaction mode usually relies on PowerShell. If you need to invoke MSYS2, UCRT64, or Git Bash environments within agent sessions, simply relying on system configuration may be unstable. This article introduces a standalone executor plugin that directly invokes these Bash environments in DSH.

Plugin Overview

dsh-msys2-bash-executor is a standalone, configurable Bash executor maintained by user 3223698962. It aims to solve the problem that DSH does not natively support Unix shells on Windows. The plugin directly handles argv via DSH’s subprocess service and does not use Node.js shell: true mode, providing more controllable process management.

Core Features

  • Direct argv generation: Bypasses Node.js shell: true mode by passing the argument array directly.
  • Automatic detection: Automatically detects MSYS2, UCRT64, Git Bash, and bash in PATH.
  • Flexible configuration: Configurable executable file, Bash arguments, PATH prefixes, and environment variables.
  • Process management: Supports timeout, abort, output limits, background jobs, incremental reading, and process tree termination.
  • UI support: The DSH Web settings page provides configuration cards in Chinese and English.
  • Activation modes: Supports global activation or individual activation for specific presets (Standard, Code, Cordis, Minimal, etc.).
  • Special handling: Provides shadow handling for the Minimal preset, bypassing the Windows persistent terminal check path that DSH does not support.

Installation and Enablement

The plugin is currently not published to npm; it must be built locally and packaged for installation.

  1. Run check and pack commands in the plugin directory.
  2. Use the dsh command to install the local package into the Web profile.
npm.cmd run check
npm.cmd pack
dsh plugin --profile web add "C:\path\to\dsh-msys2-bash-executor-0.1.1.tgz"

After installing or updating, restart dsh web. Activation changes only take effect for newly created sessions; running sessions retain their initial tool set.

Typical Usage

Web UI Configuration

Open DSH Web settings, go to the Plugins -> Configurable plugins tab, and find the MSYS2 / Git Bash card for configuration.

UCRT64 Configuration Example

If DSH was not started from an existing UCRT64 terminal, a typical configuration is as follows:

  • Bash executable: C:\msys64\usr\bin\bash.exe
  • PATH entries to prepend:
    • C:\msys64\ucrt64\bin
    • C:\msys64\usr\bin
  • Environment variables:
    {"MSYSTEM":"UCRT64","CHERE_INVOKING":"1"}

Manual Mounting (Advanced)

If you need to manually mount the shell group in a specific preset, add the following configuration to agent.cordis.yml:

- id: shell-bash
  name: cordis:group
  group: true
  isolate:
    shell: true
  config:
    - id: msys2-bash-executor
      name: dsh-msys2-bash-executor/bash-executor
      disabled: !!js process.platform !== 'win32'

    - id: tool-bash
      name: '@deepseek-ai/dsh-tool-bash'

Applicable Scenarios and Notes

Applicable Scenarios

Suitable for scenarios where you need to run MSYS2 or Git Bash toolchains within DSH agents, such as development tasks that require Unix command-line tools or specific environment variables.

Security and Compatibility Notes

  • Not sandboxed: This executor has no sandbox protection. It runs with the full permissions of the DSH process, equivalent to danger-full-access. It does not provide the Windows ACL sandbox used by the PowerShell sandbox executor. Use it only in combination with trusted prompts, repositories, and tools.
  • Path format: Use Windows paths (for example, C:\msys64\...) in the Web settings card, because the executable is spawned by Windows Node.
  • Node version: DSH must be launched with native Windows Node. MSYS2-built Node is incompatible with the current DSH Windows launcher.
  • Subsystem calibration: If Bash starts the wrong MSYS2 subsystem (for example, running UCRT64 tools in a MinGW environment), set the MSYSTEM environment variable and ensure that the matching toolchain directory is added to the PATH prefix.

This plugin provides a standalone and controllable solution for Shell execution in DSH on Windows. More details can be found on the plugin directory page or GitHub repository.