Connects Huawei Cloud CodeArts to DeepSeek Harness with built-in OAuth2 sign-in (PKCE + DPoP) or a pasted token, after which CodeArts models are available in the DSH conversation window. Reads per-account credit balance, expiring credits and daily check-in from the CodeArts credit API, counts requests and tokens locally, and shows a per-account credits popover under the chat input box; the credits line and the upstream queue hint can each be turned off in settings.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-codearts
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:elegant01/dsh-codearts
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
English | 中文
Brings Huawei Cloud CodeArts into DeepSeek Harness (DSH), so the models CodeArts offers (GLM-5.2, Pangu, Qwen, DeepSeek, …) are usable straight from the DSH chat window.
Features
- Account sign-in: click “Sign in with Huawei Cloud” once in the settings card; the browser finishes authorization and the credential is stored automatically — no keys to copy by hand.
- Automatic renewal: the credential is renewed before it expires. If renewal fails the card tells you to sign in again instead of silently using a dead credential.
- Multiple accounts with rotation: store more than one account (sign in again from the card). When one account has no free session slot, the request moves to the next account instead of waiting — this is the actual fix for “I stopped a generation and the next question takes half a minute”.
- Optional models: choose which models appear in the picker (config
enabledModels). Unchecking one only stops recommending it; sessions already using it keep working. An empty selection means “offer everything”. - Model discovery: the plugin fetches the account’s real model list on startup and hourly (built-in, limited-time benefit and agent-center sources merged) and falls back to the built-in seed list when that fails.
- Local usage: the card and
dsh-codearts usageshow today’s and lifetime request and token counts (per model, per account), plus each account’s session-slot occupancy — which is exactly why a turn had to wait. CodeArts exposes no quota API, so these are the requests this machine sent through the plugin; the card links to the official usage page. - Usage trends: two charts on top of the Usage tab — a bar per day for the last seven days showing the cache-hit rate (three colour bands; a dip means the system-prompt prefix changed or the context grew), plus today’s token volume bucketed by hour. Hourly buckets start with this version and are not backfilled; hosts that do not return the two series simply skip the charts.
- Image input: models with vision support accept pasted or dropped images in a chat.
- Sidebar icon: optional. Tick it on the card’s Display tab and a CodeArts icon joins
the DSH icon column, opening the full-page version of the settings card in the middle
column (config
showSidebarPanel; off by default, since that column is shared by the whole host). - Fallback path: you can also paste a bare security token in the card, for scripts or troubleshooting.
- CLI:
status/models/usage/identity/doctor/logoutfor checking sign-in state, discovering models and reading usage without a GUI.
Install
See INSTALL.en.md for the full walkthrough. In short: put
package.json + lib/ + cordis.patch.yml into
profiles/<profile>/node_modules/dsh-codearts/ and register the package in the profile’s
package.json, node_modules/.package-map.json and node_modules/.modules.yaml.
# build from this repository
pnpm install && pnpm run build
node scripts/deploy.mjs [profileDir] # defaults to <home>/.dsh/profiles/desktop
Debugging does not require restarting DSH every time: see DEV.md (Chinese) —
host-side changes hot-reload through dsh-hmr, and the client card is swapped into the
browser by dsh-client-hmr.
Usage
- Open DSH settings → CodeArts card → “Sign in with Huawei Cloud”.
- The browser opens the authorization page → sign in → it redirects back to a local
callback and the credential is written to
$DSH_HOME/.codearts-auth.json. - Start a new conversation, pick the
codeartsprovider, then pick a model.
CLI
dsh plugin --profile <profile> exec dsh-codearts status [--json] # sign-in state + seed model list
dsh plugin --profile <profile> exec dsh-codearts models [--json] # discover the account's real models
dsh plugin --profile <profile> exec dsh-codearts usage [--json] # local usage ledger (not account quota)
dsh plugin --profile <profile> exec dsh-codearts identity [--fix] # stable account ids; merge duplicates
dsh plugin --profile <profile> exec dsh-codearts doctor # secret-free diagnostics
dsh plugin --profile <profile> exec dsh-codearts logout # drop the credential this plugin stored
models is the first thing to run when a model is missing from the picker: it prints what
the upstream actually returns (built-in / limited-time benefit / agent-center, merged)
rather than the hand-maintained seed list.
usage reads the plugin’s own ledger ($DSH_HOME/.codearts-usage.json, kept per day for
60 days) — not an account balance: CodeArts has no quota API. Official detail lives at
codearts.huaweicloud.com/portal/settings/personal-usage, which the card also links to.
identity prints the stable upstream user_id for each stored account (the same id twice
means a duplicate entry); --fix merges those onto the stable key and backfills
user_name / domain_id.
doctor prints only paths, booleans and versions — never token material — so its output is
safe to paste into a bug report. logout removes only this plugin’s own copy of the
credential; nothing outside the plugin is touched.
Architecture
The structure follows dsh-codebuddy-cli: a local loopback shim plus a pi-ai adapter.
DSH chat window
│ OpenAI /chat/completions, Bearer=<per-process random secret>
▼
dsh-codearts shim (127.0.0.1:random port)
│ injects x-auth-token: <Huawei Cloud STS security_token>
│ + Huawei Cloud AK/SK SDK-HMAC-SHA256 signature
▼
CodeArts /api/v2/chat/completions
The shim binds loopback only and validates Host, Origin and the per-process secret, so other local processes cannot impersonate it.
Known limitations
- Credentials last about 2 hours and are renewed before expiry (the refresh token is bound to the DPoP key). When renewal fails, the card asks you to sign in again.
- The upstream caps concurrent sessions per account at 3, and a session is only released after about a minute — stopping a generation does not give the slot back: even a run that lasted under a second occupies one for the full minute. That is upstream behaviour and the client cannot release it early. Adding a second account in the card works around it, because requests rotate to an account with room.
- With a single account, asking again right after stopping a generation may still take about half a minute. The plugin queues and retries automatically; the UI simply shows nothing new while it waits.
- The login response carries no user identity (measured:
user_id/user_nameare empty strings), so after signing in the plugin asks/snap-manager/v1/current/userfor the stableuser_idand keys accounts on that: a re-login of the same account updates the existing entry instead of creating a new one. When that probe fails (network, API change) the old behaviour returns — accounts keyed by their DPoP public key, where a re-login looks like a new account and the old entry goes stale on its own. Legacy duplicates can be merged withdsh-codearts identity --fix(running it without--fixis read-only). - Advertised parameters are not always usable: the benefit gateway advertises
max_tokens393216, while the chat endpoint rejects anything above 65536 withInferHub.001001005.400. Requests are clamped to the measured ceiling per model (65536 for the free DeepSeek family, 131072 for GLM-5.2, which was measured); models without a measurement fall back to the conservative 65536. - Context window starts from the discovered value, but the free tier’s real window can be
far smaller than advertised and it drifts (issue #9). When long sessions always fail, correct
it per model with
contextWindowOverrides, e.g.{ "deepseek-v4.1-flash-1017": 491520, "glm-5.3-flash": 774000 }. Separately, whenmax_tokensis already at the 8192 floor and upstream still rejects the request, the plugin records this request’s prompt estimate as that model’s upper bound (in-process, tighten-only), so the next round is blocked locally with a/compactor new-session hint. - Output limit is overridable per model too (issue #15): enterprise custom models were
measured at 131072, while the conservative global cap is 65536. Set that model’s ceiling with
maxTokensOverrides, e.g.{ "my-enterprise-model": 131072 }(the card popover has an “Output limit” slider as well). Values that are too high self-heal via the 400 → halve retry. - Concurrency: each account has its own in-flight cap, default 2 (the free tier allows
3 sessions, leaving one for the CodeArts web console). Enterprise plans were measured at 5 —
raise just that account with the −/+ stepper inside its card; changes apply immediately and
only affect that account. Config keys:
maxConcurrentOverrides(per account) andmaxConcurrentPerAccount(the default). - The usage ledger counts only requests this machine sent through the plugin, so its
numbers are not an account total; the card links to the official page. The ledger keeps
60 days and is lost when you move machines or clear
$DSH_HOME. - Docs: README and INSTALL have English versions; DEV.md (hot-reload dev loop) is Chinese-only for now.
Changelog
See CHANGELOG.md for the changes in each release.
Disclaimer
- This project is for personal study and research only. It drives the user’s own account from the user’s own machine; do not use it commercially or beyond reasonable personal use.
- Users must comply with the Huawei Cloud and CodeArts terms of service. Any consequence of using this project (including but not limited to account restrictions or service interruption) is the user’s own responsibility.
- The author is not liable for any direct or indirect loss caused by using or misusing this project.
- This project is not affiliated with, authorized by, or endorsed by Huawei or DeepSeek. Product names appear only to describe compatibility, and their trademarks belong to their respective owners.
Acknowledgements
- dsh-codebuddy-cli (MIT) — this plugin’s DSH plugin structure, loopback shim and provider registration follow it.
License
Links
More in this category
Ebony-Vinyl/dsh-our-free-model★ 91554
Adds free model lanes to DeepSeek Harness — DeepSeek V4.1 Flash, Kimi K3 and others — with no login, sign-up or API key, plus a local OpenAI-compatible gateway, fallback routing and a usage dashboard.
dingminhua/dsh-connect-workbuddy★ 2164
Connects locally signed-in WorkBuddy models, CN and international alike, to DSH, reading each model's credit multiplier from the upstream catalog on every refresh, with per-model image input toggles, account switching backed by an auto-failing-over pool, manual daily check-in, and read-only credit overviews shown as compact pills on the card and in the composer.
Alice-Marx/dsh-model-router★ 1029
Routes DeepSeek Harness work across configured model APIs and supported vendor CLIs with dependency-aware packages and cost previews.
V1ki/dsh-plugin-subscriptions★ 646
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.
XDTrees/dsh-workbuddy-xdpool★ 644
Merge every locally signed-in WorkBuddy account into DeepSeek Harness as one auto-failing-over model pool (multi-account rotation, live credits, and a model catalog showing per-model credit multipliers and free/night-discount tags).
XDTrees/dsh-xdpool★ 644
Merge every locally signed-in WorkBuddy account into DeepSeek Harness as one auto-failing-over model pool: multi-account rotation, 429 cooldowns, live credits, a model catalog with per-model credit multipliers and free/night-discount tags, QR-code login for 13 vendors, and aggregate free-tier channels. Accounts persist across restarts.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.