DSH Trae Connect: Integrating Trae (SOLO CN) Subscription Models into DeepSeek Harness

Introduction

DeepSeek Harness (DSH) adopts a plugin-based architecture. For users who wish to utilize subscription models from the Trae (SOLO CN) desktop version but are unable to access them directly via API, the dsh-trae-connect plugin offers a connectivity solution. It exposes Trae’s preset models to DSH through OpenAI-compatible endpoints, causing a Trae group to appear in the model selector where users can engage in direct chat.

Core Functions

The plugin implements protocol conversion between Trae and DSH via a loopback shim:

  1. OpenAI-Compatible Interface
    The plugin provides standard /healthz, /v1/models, and /v1/chat/completions interfaces, enabling DSH to recognize it as a standard OpenAI-compatible service.

  2. Protocol Translation
    Trae’s upstream interface returns SSE events, and the plugin translates them into OpenAI-format chat.completion.chunk messages, ensuring DSH can correctly parse the streaming responses.

  3. Security Isolation and Credential Reading
    The shim binds only to a random port on 127.0.0.1 and uses a 32-byte random bearer token for authentication. The plugin does not directly read the host system’s encrypted credentials; instead, it reads a plaintext credential snapshot exported by the host-side script (default path $DSH_HOME/trae/). It loads this data in read-only mode and does not modify the DSH profile’s current default model settings.

Installation and Dependencies

Before installation, ensure your environment meets the following requirements:

  • DSH Core: Must match the 0.1.5 / 0.1.6 / 0.1.7 alpha line.
  • Node.js: Version must be ^22.19.0 or >=24.0.0.
  • Prerequisites: Trae (SOLO CN) desktop version must be installed and logged in, and the credential snapshot must have been exported via a host-side script.

Execute the following command to install the plugin:

dsh plugin --profile web add github:yembors64632/dsh-trae-connect

Note: For the Desktop / TUI interface, please replace --profile with desktop or tui.

Use Cases and Considerations

This plugin is designed as a personal self-use solution for learning and research purposes only.

  • Environment Dependencies: The plugin configuration is hardcoded based on the original author’s machine environment; containers cannot directly access the host’s macOS directories. Credentials must be decrypted and exported as plaintext snapshots by a host-side script, and the plugin only reads these snapshots.
  • Version Compatibility: A mismatch in the DSH core version will cause the plugin to fail to start; please verify version numbers carefully.
  • Upstream Risks: Trae’s API is a private implementation, and interface changes may cause the plugin to fail.
  • Licensing and Disclaimer: This project is licensed under the MIT License. Users must comply with Trae’s Terms of Service independently. The user assumes full responsibility for any consequences arising from the use of this project (including account restrictions, credit consumption, etc.). The repository does not contain any real accounts or credentials.
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye