Introduction¶
When integrating WorkBuddy as the model output gateway within DeepSeek Harness (dsh), credits are often scattered across multiple accounts: one has to remember to check in daily, manually check balances, and it is also hard to know exactly how many credits a specific conversation consumes. The community plugin dsh-workbuddy-pool (maintainer shiquanchai, category: Network Tools) aggregates multiple WorkBuddy accounts into a “pool,” provides a dashboard in the dsh sidebar, and optionally connects to a reverse proxy for the account pool to log request usage per session. Below is an introduction to what it does, how to install it, and its relationship with the reverse proxy.
What is this¶
dsh-workbuddy-pool is a WorkBuddy account pool plugin for dsh: it performs multi-account import, automatic daily check-ins to collect credits, and scheduled refreshes of balance snapshots. Once a reverse proxy and usage logs are configured, it attributes credit consumption per dsh session. The host process handles check-ins, storage, and the HTTP API, while the browser side adds a WorkBuddy button in the sidebar to open a detailed view. Data communication with the official interface goes through https://copilot.tencent.com (which can be changed to gateway in the configuration).
Repository: shiquanchai/dsh-workbuddy-pool
Community Directory: skillhub plugin page
License: MIT (see repo LICENSE); package version 1.0.0, requires Node >= 20.
Core Features¶
Account Pool & Import¶
- Capture the currently valid login state from the WorkBuddy desktop app in one go, or import via a pasted token in the command line; it deduplicates by UID/phone number, and repeated imports update the token.
- Supports adding accounts, ON/OFF (only decides whether to use that account’s credits for consumption, does not affect check-in or refresh), and deletion (requires confirmation).
- Data is stored in
%DSH_HOME%/workbuddy-pool/(default likeC:\Users\<you>\.dsh\workbuddy-pool\). The core file ispool.json. Cross-process serialization usespool.json.lock, and the plugin, CLI, and reverse proxy write to the same file together.
Check-in & Balance¶
- At local time 00:05 every day, it automatically checks in for all accounts (ON/OFF both check in), with automatic retry on failure; the page or API allows “Check in Now”.
- Balance and credit composition are displayed by plan base, plan bonus, purchase, and platform rewards; the remaining validity of the token is visible.
- “Daily New” is estimated by taking the larger value of the balance snapshot difference and check-in records; “Daily Consumption” is precisely accumulated from the
creditreturned by the reverse proxy after connecting.
Dashboard & Attribution¶
- KPI: Total Balance, Today’s New (including check-in), Today’s Consumption, This Week’s Net Change.
- Last 7 days daily credit bar chart, this week line chart; session cards and rings display consumption for each conversation, viewable by request count, tokens, credits, etc.; deletion only removes statistics, does not touch the conversation, and can be restored with one click.
- When not connected to a reverse proxy: account, check-in, and balance are normal; each conversation’s consumption has no data. After the reverse proxy runs, the plugin aggregates usage by reading
usage.jsonlviausageLog.
Architecture Highlights¶
The plugin itself is located in the repository root (lib/index.js for the host, lib/client.js for the sidebar and page); proxy/ provides a WorkBuddy → OpenAI compatible reverse proxy (default :8787), the account pool polls and writes to logs/usage.jsonl. The host can inject x-wb-session-id into dsh’s llm-pi-ai/request-headers, used for session-level attribution.
Installation & Enabling¶
Prerequisites: dsh 0.2.2-rc.x (desktop or web profile), Node 20+. “Import from desktop” requires Windows and the WorkBuddy desktop app to be logged in.
The installation method in the documentation is to clone the repository and use install.mjs to link to the profile (it will backup package.json / cordis.patch.yml, write dependencies["dsh-workbuddy-pool"] = "link:<current dir>", and add to dsh.profile.bundles):
git clone https://github.com/<you>/dsh-workbuddy-pool.git
cd dsh-workbuddy-pool
$node = "<dsh's bundled node.exe>" # or system node
& $node scripts\install.mjs install --profile desktop
# The output will print the backup directory; after restarting dsh, the WorkBuddy button will appear in the sidebar
Uninstall:
& $node scripts\install.mjs uninstall --profile desktop
Start the reverse proxy separately and point the baseURL of the workbuddy provider in dsh to local:
& $node proxy\wb-proxy.mjs
# In llm-pi-ai, workbuddy provider baseURL → http://127.0.0.1:8787/v1
Override the usage log path by id in the profile’s cordis.patch.yml (example):
- id: workbuddy-pool
config:
usageLog: 'D:\path\to\proxy\logs\usage.jsonl'
The plugin runs with the permissions of the current dsh process; before installing, you should review the source code and the MIT license yourself; the community directory is an independent site with no official affiliation with DeepSeek / Huansuan.
Typical Usage¶
Import & Manage Accounts¶
- Top right corner of the page “Import Account” -> “Import current logged-in account from desktop”.
- Or via command line:
node scripts\import.mjs --desktop
node scripts\import.mjs --desktop --label 小号
node scripts\import.mjs --token eyJ... --label 小号
When there are multiple accounts, switch login in the desktop app and import again. Common maintenance commands:
node scripts\import.mjs --list
node scripts\import.mjs --refresh
node scripts\import.mjs --checkin
node scripts\import.mjs --rename acc-xxxx --label X
Configuration (cordis.patch.yml, can be overridden by id)¶
| Key | Default | Description |
|---|---|---|
enabled |
true |
Master switch for the timer |
checkinAt |
"00:05" |
Automatic check-in daily (local time) |
snapshotMinutes |
30 |
Balance snapshot interval |
autoHarvest |
true |
Automatically renew tokens when they expire soon from the desktop app |
harvestMinTokenDays |
3 |
Days remaining considered “soon to expire” |
usageLog |
%DSH_HOME%/workbuddy-pool/usage.jsonl |
Reverse proxy usage log path |
gateway |
https://copilot.tencent.com |
Official interface gateway |
Local API (loopback, /workbuddy-pool prefix)¶
For example: GET /workbuddy-pool/api/status to pull dashboard main data; POST /workbuddy-pool/api/checkin to trigger check-in; GET /workbuddy-pool/api/usage?days=14 to query daily and session aggregation. See the “Interface” section in the repo README for the full list.
Static preview: https://shiquanchai.github.io/dsh-workbuddy-pool/.
Use Cases & Notes¶
Who is this for: Teams or individuals who frequently use dsh via the WorkBuddy output gateway, have multiple accounts to check in and view balances for, and are willing to maintain desktop login or tokens on Windows.
Known Limitations (excerpted from README):
- Token validity is about 30 days; it can only be automatically renewed when the account is logged into the WorkBuddy desktop app; otherwise, re-import is required.
session_idis injected after the plugin loads; historical requests prior to this show as “Unattributed (date)”.- Without
wb-proxy, there are noaccount_id/session_id/creditrecords. - Phone numbers returned by the interface are masked, and the plugin masks them further using the number inside the JWT for display.
Self-check (does not touch the real account pool, except host-check can optionally read the local .wb-token):
node tests\host-check.mjs
node tests\client-check.mjs
Issue feedback: Issues; Discussion: Discussions.
Conclusion¶
After the above steps, you can converge multi-account check-ins, balance, and (optional) session-based consumption of WorkBuddy to the dsh sidebar. For details and updates, refer to the GitHub repository; see the skillhub directory page for the community index.