Preface¶
The ecosystem philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When using dsh-router, if you need to connect to the Tencent CodeBuddy family of services (including the China version CodeBuddy and the international version WorkBuddy), dsh-router-codebuddy is the required provider registration plugin. This plugin is maintained by developer CARVIN94. Its core function is to register two providers to DSH through dsh-router, providing OAuth polling login, model list retrieval, and OpenAI-compatible gateway capabilities.
Core Features¶
This plugin registers providers to the core through the router.suppliers service and has the following capabilities:
- OAuth polling login: Generates a login link. After logging in via the browser, the backend polls for a token every 5 seconds, for up to 5 minutes. Credentials are automatically persisted to disk, and there is no need to manually paste a callback.
- Model list: Dynamically fetches upstream models in real time via
GET /v3/config. If the endpoint is unreachable, it falls back to a built-in fallback table, and allows manually adding custom models. - Interface normalization (international version only): Performs interface normalization for the international WorkBuddy version, mapping
developertosystem, handling the object form oftool_choice, and avoiding parameter errors. - Connection pooling: Multi-account management is handled by the core. This plugin only reports the success/failure and semantic status of a single account.
- Automatic token refresh: Automatically refreshes the token using the refresh token within 24 hours before expiry. If refresh fails, it continues using the old token.
- Check-in for points: Daily check-in earns 100 points (1,000 points for 7 consecutive days). The core iterates through all accounts and calls it for each account.
- Points display: The panel displays the remaining quota (
CapacityRemain) fromget-user-resource. Point persistence is handled uniformly by the core.
Installation and Activation¶
This plugin depends on the dsh-router-core core package. Make sure it is installed before installing this plugin. After installation and activation, dsh web must be restarted for the changes to take effect.
- Install core:
dsh plugin --profile web add dsh-router-core
- Install this plugin:
dsh plugin --profile web add dsh-router-codebuddy
- Restart service:
dsh web
Typical Usage¶
After the restart is complete, perform the following steps in the panel:
- Go to the “Suppliers” page in the panel and find the
CodeBuddyorCodeBuddyENcard. - Click “Add Link”. The system opens a browser window for OAuth login. After successful login, the account is automatically added to the account pool.
- On the provider details page, click “Fetch Models” to retrieve the model list from the upstream service.
- When initiating a request, the model name can be
glm-5.3-flash, or it can be used with an alias prefix ascodebuddy/glm-5.3-flash(the plugin automatically removes the prefix).
Applicable Scenarios and Notes¶
- Dependencies: Installing this plugin alone is not sufficient.
dsh-router-coremust be installed first. - Restart requirement: After the installation command completes,
dsh webmust be restarted for the plugin to register the provider to the core. - Points mechanism: Persisted storage of points is handled uniformly by the core. The plugin only returns
-1when data cannot be retrieved, and the core retains the last persisted value. - Local development: For local development, add
"dsh-router-codebuddy": "link:/path/to/dsh-router-codebuddy"todependenciesinstead of installing it from npm.
Conclusion¶
dsh-router-codebuddy provides DSH users with a standard interface for accessing the CodeBuddy family of services. It uses a unified implementation class to handle differences between the China and international versions. Combined with dsh-router’s connection pooling and fallback strategy, it enables stable multi-account management and model invocation. For more details, refer to the project source code or documentation page.