dsh-opencode-go-quota: View OpenCode Go Quota in the DSH Sidebar

Preface

When using OpenCode Go for model invocations within DeepSeek Harness (DSH), checking subscription quotas typically requires switching to the official OpenCode dashboard or opening a separate tool. This interrupts the flow just to see usage statistics for rolling 5-hour windows, the current week, or the billing cycle, as well as reset times. Relying on “feel” to manage model usage during development often leads to exceeding limits within a specific window faster than expected, only discovering the issue when errors or rate limits occur.

Below is an introduction to the community plugin dsh-opencode-go-quota (Maintainer: WihteCo, Category: Client). It embeds data from the official OpenCode Go usage API into the bottom of the left sidebar in the DSH web client, occupying the same area as the workspace/session list and settings. It displays three quota tiers via a compact UI row and an overlay popover, ensuring that the API Key remains strictly within the Host process and is never sent to the browser.

What is this

dsh-opencode-go-quota is a bundle + web client plugin for DSH: the Host side proxies GET /api/opencode-go-quota, while the Client side registers to sidebar.footer.action to display OpenCode Go quotas in the sidebar footer.

The DSH ecosystem follows the philosophy that “everything is a plugin.” Community directories like SkillHub are independent sites and have no official affiliation with DeepSeek or Hithink. Before installing third-party plugins, it is recommended to review the source code and license yourself—plugins run with the permissions of the current DSH process.

Core Features

Area Behavior
Expanded Sidebar A 42px cell row: A small progress ring on the left indicates progress; the right side displays text like “18% this month,” where the number reflects the used percentage of the most constrained of the three tiers.
Collapsed Sidebar (56px vertical bar) A 36px circular button displaying the percentage number directly.
Hover / Click A 320px popover: Displays one row each for the rolling 5-hour window, the current week, and the current month. Includes a 6px usage bar, a vertical line for time progress, remaining percentage, and reset countdown.
Popover “Refresh” Immediately re-fetches data, bypassing the Host-side 30-second cache.

Popover illustration for each tier (see README for meaning):

5-hour window                       8% Used
▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   ← Fill=Usage; Vertical Line=Time Progress
92% Remaining           46% Time Elapsed      Resets in 2 hours 12 minutes
  • If the vertical line is to the right of the fill: usage is slower than the time elapsed (relatively safe); if to the left: usage is faster than time (should be cautious).
  • The time progress for “Current Month” includes ≈: The billing cycle start time is not provided in the API, so it is estimated by counting back one calendar month from the reset time; the 5-hour window and “Current Week” are exact windows (5 hours / 7 days).

Color rules: Usage < 70% is brand blue, 70%–89% is yellow, ≥ 90% is red; if data cannot be retrieved, it displays as gray --.

Data and Authentication

  1. The browser only requests the same-origin GET /api/opencode-go-quota (the Host rejects cross-site invocations).
  2. The Host uses the existing OPENCODE_GO_API_KEY from the DSH credential library (consistent with the environment variable pointed to by apiKeyEnv for the opencode-go provider in cordis.patch.yml) to request the upstream
    https://opencode.ai/zen/go/v1/usage.
  3. Key does not enter the browser; Upstream response example:
{"usage":{
  "rolling":{"status":"ok","percent":5,"resetsAt":"2026-10-07T06:00:12.000Z"},
  "weekly":{"status":"ok","percent":5,"resetsAt":"2026-10-12T00:00:00.000Z"},
  "monthly":{"status":"ok","percent":17,"resetsAt":"2026-10-28T11:29:15.000Z"}}}
  1. The three tiers correspond to the OpenCode dashboard: rolling = Rolling 5 hours; weekly = This week (resets Monday UTC); monthly = Current billing cycle. The numbers reflect the account-wide metric (including usage from other machines).
  2. The page auto-refreshes every 60 seconds; the Host has an additional 30-second cache. The upstream uses cache-control: no-store, so usage changes in real-time with actual calls.

Installation and Activation

Installation (README example: If the local desktop profile already has the bundle installed, target is the plugin directory or an absolute file: path):

plugin_manager  action=install_bundle  target=<plugin_directory_or_file:/absolute/path>

Uninstallation:

plugin_manager  action=remove_bundle   target=dsh-opencode-go-quota

Temporary Deactivation:

plugin_manager action=set_plugin target=opencode-go-quota enabled=false

Usually, no DSH restart is required after installation; if the sidebar does not appear immediately, simply refresh the browser page.

Typical Usage

  1. In DSH “Settings → Models,” configure the API Key for opencode-go (corresponding to the environment variable OPENCODE_GO_API_KEY).
  2. After installing the bundle via the command above, open the DSH web version and view the quota cell at the very bottom of the left sidebar (below the workspace/session list).
  3. To view details for the three tiers, hover or click the cell to open the popover; if you suspect the data is stale, click “Refresh” within the popover.
  4. To troubleshoot if the Host is functioning correctly, you can run locally:
curl -s http://127.0.0.1:19387/api/opencode-go-quota

(The default port depends on your local DSH configuration; the README example uses 19387.)

Use Cases and Notes

Who it is for: Developers who have configured OpenCode Go in DSH and want to monitor the three quota tiers and reset times without switching sites while coding or running agents for extended periods.

Common Errors (README Troubleshooting Section):

  • Card displays red error text: Hover the mouse to see the full message.
  • Credential OPENCODE_GO_API_KEY not configured → Fill in the API Key for opencode-go in the settings.
  • Quota API returned 401 → The Key is invalid or has been rotated; please refill it.

Security and Permissions: The plugin accesses the official OpenCode usage API using the stored Key on behalf of the Host. Before installation, please confirm the repository source and MIT license, and understand that it runs with the same process permissions as the main DSH program.

Conclusion

dsh-opencode-go-quota consolidates the three usage tiers and reset countdowns of OpenCode Go into the DSH sidebar footer, protecting the API Key via a Host proxy. If you are selecting a client-side DSH plugin on SkillHub or GitHub, this is a great place to start:

  • Directory Page: https://www.skillhub.cn/plugins/WihteCo/dsh-opencode-go-quota
  • GitHub: https://github.com/WihteCo/dsh-opencode-go-quota
羽毛球分组比赛记分
小程序二维码

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

Xiaoye