dsh-modelscope-pts: View ModelScope Magic Points Balance and Manage Daily Interactions in DSH

Introduction

When developing agents with DeepSeek Harness (DSH) that call models on ModelScope, developers often need to monitor the Magicubes (credits) balance on their account. Without an intuitive balance indicator, it’s easy to encounter call failures or exhaust the quota unexpectedly. The dsh-modelscope-pts plugin displays the remaining Magicubes balance of your ModelScope account in real time within both the DSH Desktop model selector and the plugin management page. It also provides a daily interactive reward collection feature, helping developers manage their usage and tasks more conveniently.

What It Is

dsh-modelscope-pts is a DSH Desktop plugin developed by maintainer ORIOW. It reads the ModelScope balance API and displays the balance in two locations: a Magicubes count label (Magicubes N) to the right of each ModelScope model entry in the model selector, and a full balance panel on the plugin page. The plugin also includes an independently toggleable daily Magicubes interaction component that periodically upvotes unstarred models to earn Magicubes and automatically opens the browser to claim the daily login reward.

Core Features

Balance Display & Low-Balance Alerts

The plugin reads the ModelScope balance endpoint:

GET https://www.modelscope.cn/openapi/v1/magicubes/balance

and displays data.available_balance (available balance) and frozen_amount (frozen amount). The plugin page shows both values, while the label in the model selector displays only the available balance. When the available balance drops to 25 Magicubes or below, a red warning triangle appears to the right of the label, and the tooltip on hover appends a “low balance” warning.

Daily Magicubes Interaction (modelscope-magicube)

This component is a scheduled task that upvotes unstarred models to earn Magicubes (2 points per upvote, capped at 10 per day):

  • Selects unstarred models from the ModelScope catalog, skipping your own models (determined by path owner and creator). It reads up to 6 pages of 100 entries each and shuffles the order before selection.
  • The run time is configurable on the component card (default 09:30). If DSH is not running at that time, it will complete the day’s interaction on the next startup.
  • If the run fails (network not ready, expired Cookie), it will not auto-retry for the rest of the day; you can manually trigger it using the “Run now” button on the component card.
  • A random interval of 1–10 seconds is applied between each upvote.
  • The first daily interaction of the day (whether scheduled or manual) attempts to open the ModelScope page in your default browser to claim the login reward (at most once per day). The default URL is https://www.modelscope.cn/my/overview. This behavior can be disabled on the component card or the URL customized.
  • Displays daily upvote/failure/skip statistics; run records are stored in a volatile configuration field and remain viewable after restart.
  • Requires a session Cookie (shared with the balance component); upvoting is performed exclusively via Cookie (access tokens cannot complete upvotes).

Model Availability Probe

The plugin includes a built-in model availability probe to check whether ModelScope models you’ve added in DSH are still serviceable:

  • The probe interval is configurable on the component card (default 14 days, minimum 1 day).
  • During the probe, it reads config.providers.modelscope.models[].id from the DSH configuration file (preferring DSH_PROFILE_DIR, falling back to %APPDATA%\dsh-desktop\harness\profiles\desktop\cordis.patch.yml).
  • Retrieves the list of serviceable models via GET https://api-inference.modelscope.cn/v1/models. If MODELSCOPE_API_KEY is set, it is sent as a Bearer header (this value is never logged or exposed via RPC/UI).
  • For models not in the list, a further check via GET /api/v1/models/{ns}/{name} is performed: a 404 response with error code 10010205001 indicates “delisted”; a 200 response means the model exists but is not available; presence in the list means “available”.
  • Results are grouped by model task category. If any models are delisted, a red warning “⚠ N added models have been delisted: …” is shown in the summary line. The probe operation is read-only and does not modify your model configuration.

With popupNotify enabled by default, the plugin shows a small portal notification in the bottom-right corner of the window:

  • After the daily interaction completes, it displays “Daily interaction complete” along with success/failure/skip counts. If a hard error is encountered, a warning card with the error message is shown.
  • If the session Cookie expires and the interaction is interrupted, a “All credentials expired” alert is shown only if the access token is also invalid, prompting reconfiguration; otherwise the failure is handled silently.
  • When the probe detects delisted models, a warning card listing those models is displayed.
  • The first snapshot after page load is treated as a baseline and does not trigger a notification; unchanged run results do not re-trigger; disabling popupNotify suppresses all notifications while still recording the baseline; clicking the popup dismisses it, and it auto-disappears after a few seconds.

Credential Management

ModelScope uses session Cookies for authentication, and DSH plugins cannot directly read Cookies from the browser. Therefore, credentials must be entered manually on the plugin configuration page:

  • Access Token (ms-…): Sent as Authorization: Bearer <token>.
  • Session Cookie: Used as the complete Cookie header string directly.

The strategy is “token first, Cookie fallback”: if a token is configured, it is used preferentially; if the token results in 401/403 and a Cookie is also configured, it falls back to the Cookie; if only a Cookie is configured, the Cookie is used directly. Credentials are stored in DSH’s host credential store, never written to the plugin config file, and never echoed in the UI.

Installation & Enablement

Install the plugin via the catalog page on the DSH Desktop plugin management page (catalog page link at the end of this article).

Typical Usage

  1. Find dsh-modelscope-pts on the plugin management page and navigate to “Installed → dsh-modelscope-pts → Configure”.
  2. Configure credentials (access token or session Cookie) in the “ModelScope points” card.
  3. Set the run time (e.g., 09:30) and enable the component toggle in the “ModelScope daily magicubes” card.
  4. On the first run, the plugin automatically opens the browser page to claim the daily login reward (can be disabled or the URL customized on the card).
  5. After the daily interaction completes, a “Daily interaction complete” notification appears in the bottom-right corner showing success/failure/skip counts.
  6. If delisted models are found in the model list, use the “Probe now” button to trigger a probe and view the categorized results with red warnings.

Use Cases & Notes

This plugin is ideal for developers who frequently call ModelScope models in DSH Desktop and want real-time balance visibility along with automated daily Magicubes collection. Before use, please verify the plugin’s source and license, and review the source code and documentation before installation. The plugin runs within the DSH Desktop process; ensure your network environment and permissions meet the requirements.

Conclusion

dsh-modelscope-pts integrates ModelScope Magicubes balance viewing and daily interaction tasks into the DSH workflow. Through intuitive UI indicators and automated operations, it helps developers manage usage and reward collection more efficiently. For more details and source code, visit:

  • Catalog page: https://www.skillhub.cn/plugins/ORIOW/dsh-modelscope-pts
  • GitHub: https://github.com/ORIOW/dsh-modelscope-pts
羽毛球分组比赛记分
小程序二维码

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

Xiaoye