Connects locally signed-in Trae CN models to DSH, supports DSH-executed tool calls, account switching, and Work/general credit visibility.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-connect-trae
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:dingminhua/dsh-connect-trae
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
A DeepSeek Harness (DSH) bundle plugin that connects locally signed-in Trae CN models to the DSH model picker. Trae generates structured tool calls while DSH executes its own local tools, with a read-only Work/general credits and model-management panel.
Features
- Trae model provider — registers locally signed-in Trae models as the
traeprovider (e.g.DeepSeek-V4-Flash,DeepSeek-V4-Pro). - DSH local tool loop — gets pending structured
tool_callsfrom Traellm_utils_chat, lets DSH execute its own local tools, then returns tool results to the model. - Trae CN account switching — detects local Trae CN and TRAE SOLO CN sign-ins, refreshes the token list, and lets users select an account without storing tokens in DSH settings.
- Read-only credits and model management — shows Work credits separately from the general credits usable by DSH, and manages which Trae models are enabled. Read-only queries do not consume credits.
- Secure loopback shim — random port + in-process random secret; the real Trae token is never handed to pi-ai.
How it works
DSH PiAiAdapter
-> secure loopback shim
-> TraeSoloBridge
-> https://trae-api-cn.mchost.guru/api/agent/v3/llm_utils_chat
-> Trae SSE / pending function_call
-> OpenAI SSE tool_calls
-> DSH executes local tools and returns their results
Usage overview hits the read-only https://api.trae.cn/trae/api/v2/pay/* and /trae/api/v2/ug/* endpoints.
See
docs/IMPLEMENTATION_PLAN.md,docs/SOLO_ROUTE_DECISION.md,docs/USAGE_API_RESEARCH.md.
Install
dsh plugin --profile desktop add dsh-connect-trae
Or directly via npm:
npm install dsh-connect-trae
Restart the DSH process after install/update/uninstall.
Windows notes
- Account data directory: the plugin reads
%APPDATA%\Trae CN/%APPDATA%\TRAE SOLO CN→User\globalStorage\storage.json(unrelated to the install directory). The folder names match macOS, so no extra config is needed; if the name does not match, point theauthFile+editionplugin options at the exact path. - App version headers: the plugin reads
appVersionfrom<LOCALAPPDATA>\Programs\<AppName>\resources\app\product.jsonand sendsx-app-version/x-ide-version; if unreadable, those headers are omitted (same as the previous behavior). - Raw Chat probing (known limitation):
model-cachedepends on thesqlite3command-line tool, which is not installed by default on Windows; Raw Chat capability probing fails and falls back safely. Raw Chat is off by default and does not affect the main flow. - See
docs/WINDOWS_TOKEN_PROBE.mdfor troubleshooting.
Development
pnpm install
pnpm run check # typecheck + test + build
Local dev via a link: install to the desktop profile (restart DSH Desktop after editing):
dsh plugin --profile desktop add /Users/dmh2002/DshProject/dsh-connect-trae
Acknowledgements
- Wang-JQ77/dsh-trae-api (MIT) — Reference implementation for research into Trae authentication, sessions, and model protocols.
Third-party open-source dependencies
The open-source projects referenced for Trae integration (architecture/protocol research), together with their licenses and compliance notes, are recorded in THIRD_PARTY_NOTICES.md. When introducing new Trae-related external dependencies or reusing code from other projects, update that file accordingly and honor the upstream licenses.
License
This project is licensed under the MIT License. Copyright: Copyright (c) 2026 LaoDing.
Links
More in this category
V1ki/dsh-plugin-subscriptions★ 303
Use ChatGPT (Codex), Claude, and Grok subscriptions as DeepSeek Harness LLM providers, with Settings login, model catalogs, usage, plus image_generate, video_generate, and x_search tools.
Mars-Sea/dsh-commandcode-provider★ 133
Unofficial Command Code LLM provider: registers a `commandcode` route with a live model catalog and reasoning-effort support.
Stormycry-cryp/dsh-AuthInOne★ 105
Adds account login, API and custom Provider setup, model switching, image fallback for text-only models, and token/cost attribution to DeepSeek Harness 47f.
franksong2702/dsh-codex-connect★ 67
Connect ChatGPT OAuth and OpenAI Codex models to DeepSeek Harness, with opt-in search and image tools.
amlyczz/dsh-agy-link★ 30
Google Antigravity (agy CLI) models for DSH — streaming chat with Gemini/Claude/GPT-OSS subscriptions, native tool cards, thinking turns, and in-GUI Google OAuth login.
WSL043/dsh-codex-subscription★ 30
ChatGPT OAuth provider for Codex models with subscription web search, quota and safe reset, image tools, Fast mode, and model-aware context; no API key or Codex CLI.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.