dsh-codearts: Integrating Huawei Cloud CodeArts Models into DeepSeek Harness

Introduction

DeepSeek Harness (DSH) adopts a plugin-based architecture, allowing users to extend its functionality through plugins. Huawei Cloud CodeArts provides a variety of models, including GLM-5.2, Pangu, Qwen, and DeepSeek. Using these models directly within the DSH conversation window typically requires manual API key configuration or switching to an external interface. The dsh-codearts plugin aims to solve this fragmentation issue by integrating CodeArts model resources directly into the DSH conversation flow.

Overview

dsh-codearts is a network-enabled tool plugin maintained by elegant01. Its core function is to mount Huawei Cloud CodeArts model services onto DSH via a plugin interface, allowing users to invoke CodeArts model capabilities without leaving the DSH environment.

Core Features

The plugin implements the following capabilities:
- Account Login: Utilizes the OAuth2 + DPoP protocol for authentication. Login is completed by clicking within the DSH settings card, eliminating the need for manual key entry.
- Automatic Renewal: Credentials have a validity period of approximately 2 hours and are automatically renewed before expiration. If renewal fails, the interface prompts the user to re-login.
- Multi-Account Rotation: Supports adding multiple accounts. When the session slots for a specific account are occupied, requests automatically switch to the next available account, resolving waiting issues caused by concurrency limits.
- Model Management: Controls the models displayed in the model selector via the enabledModels configuration item; supports automatic discovery of model lists (Built-in / Limited-time Benefits / agent-center).
- Usage Statistics: Tracks local request counts, token consumption, and session slot occupancy.
- Vision Support: Supports image input.
- Fallback Mechanism: Supports manual token pasting for scripting or troubleshooting scenarios.
- Command Line Tools: Provides subcommands such as status, models, usage, identity, doctor, and logout.

Installation and Activation

The plugin needs to be built from source and deployed to the DSH profile directory. Execute the following commands in the project root directory:

pnpm install && pnpm run build
node scripts/deploy.mjs [profileDir]

Here, profileDir defaults to <user directory>/.dsh/profiles/desktop. During deployment, ensure that the build artifacts (package.json, lib/, cordis.patch.yml) are placed in the corresponding directory, and update the profile’s package.json, node_modules/.package-map.json, and node_modules/.modules.yaml.

Typical Usage

  1. Open DSH Settings, locate the CodeArts card, and click “Login with Huawei Cloud Account”.
  2. A browser window will open to the authorization page. Log in to your Huawei Cloud account. Once completed, it will automatically redirect back to the local machine, and credentials will be written to $DSH_HOME/.codearts-auth.
  3. Start a new conversation, select codearts as the provider, and choose a model to begin chatting.

Command Line Tools

The plugin provides a command-line interface for checking status and viewing details:

dsh plugin --profile <profile> exec dsh-codearts status
dsh plugin --profile <profile> exec dsh-codearts models
dsh plugin --profile <profile> exec dsh-codearts usage
dsh plugin --profile <profile> exec dsh-codearts identity [--fix]
dsh plugin --profile <profile> exec dsh-codearts doctor
dsh plugin --profile <profile> exec dsh-codearts logout
  • status: View login status and model list.
  • models: View the actual model list returned by the upstream server (including built-in, limited-time benefits, and agent-center).
  • usage: View local usage ledger (not the total account quota).
  • identity: View stable account identity; --fix merges duplicate entries.
  • doctor: Diagnose the environment without involving key content.
  • logout: Clear locally stored credentials.

Notes and Limitations

  • Credential Validity: Credentials are valid for approximately 2 hours and are automatically renewed before expiration.
  • Concurrency Limits: The upstream server limits concurrent sessions to 3 per account. Stopping generation mid-way does not release the slot immediately; waiting approximately 1 minute is required. It is recommended to add a second account for automatic rotation.
  • Identity Recognition: The upstream login response does not return a user identifier. The plugin makes an additional request to /snap-manager/v1/current/user to obtain a stable user_id.
  • Model Parameters: Model parameters (such as max_tokens) have tested upper limits. For untested models, conservative values (65536) are used.
  • Usage Statistics: The usage ledger only records requests initiated from the local machine and does not equal the total account quota.
  • Compliance: For personal learning and research purposes only. Users must comply with the terms of service of Huawei Cloud and CodeArts.

Conclusion

The dsh-codearts plugin effectively resolves the integration challenges of invoking CodeArts models within DSH by providing OAuth2 login, automatic renewal, and multi-account rotation mechanisms. This project is licensed under MIT and maintained by elegant01.

  • Directory Page: https://www.skillhub.cn/plugins/elegant01/dsh-codearts
  • Source Code: https://github.com/elegant01/dsh-codearts
羽毛球分组比赛记分
小程序二维码

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

Xiaoye