OpenCode Go Plan Quota Monitoring Plugin

Introduction

When developing agents with DeepSeek Harness (dsh), the quota information for the OpenCode Go plan is typically scattered across the model settings, making it hard to view at a glance. The existing workflow either requires switching to the model settings page or makes it impossible to quickly check the remaining quota for the current window during a conversation.

DeepSeek Harness embraces the philosophy of “everything is a plugin,” allowing developers to turn common capabilities into independently installable modules. The plugin introduced below, dsh-opencode-go-usage-monitor, is exactly that kind of plugin. It presents the three OpenCode Go quota tiers in a standalone panel and provides a summary bubble in the sidebar.

Plugin Overview

This is a DeepSeek Harness client plugin for monitoring OpenCode Go plan usage.

Maintainer: unhuman1146

Problem it solves: Exposes usage information that was previously buried in model settings as a visualized global panel and sidebar summary, making it easy to check remaining quota at any time during development.

Core Features

Global Panel Display

The plugin opens a standalone card view in the Harness panel area, showing three quota tiers:

  • 5h rolling: 5-hour rolling window
  • Weekly: Resets every week
  • Monthly: Resets every month

Each card includes:
- Remaining percentage (displayed in large text)
- Used percentage
- Usage progress bar
- Reset time
- Countdown to reset

Color rules:
- Remaining ≥50%: Green
- Remaining ≥20%: Yellow
- Otherwise: Red

If a window’s status is not ok, the card is also displayed in yellow.

The sidebar icon itself serves as the display area. Whether the sidebar is collapsed or expanded, it shows the current remaining percentage for all three tiers, formatted like:

5h 96% · Wk 99% · Mo 100%

If the data hasn’t been loaded yet (plugin just loaded or the first read failed), the bubble falls back to displaying the plugin name “Plan Quota.”

Auto-Refresh and Manual Refresh

  • Auto-refreshes every 30 seconds while the panel is open; pausing refresh when the page is hidden
  • The “Refresh” button in the top-right corner bypasses the host’s 8-second cache and reads the latest data directly from the upstream

Security Mechanism

The browser never touches the API key. The page only requests the loopback route registered by this plugin:

GET /plugins/dsh-opencode-go-usage-monitor/usage[?fresh=1]

The host is responsible for reading apiKeyEnv (defaults to OPENCODE_GO_API_KEY) from the opencode-go provider in model settings. If the host cannot read this configuration, you can set config.apiKeyEnv on the Host line in the plugin configuration to point to the same credential reference name. The host checks process environment variables first, then the Harness credential service.

All usage queries are read-only operations. There is no telemetry, and usage snapshots are kept in memory only.

Installation and Activation

Install

Use the official install command:

dsh plugin --profile web add github:unhuman1146/dsh-opencode-go-usage-monitor

Installation requirements:
- dsh >= 0.2.0-rc.2 (Web / Desktop profile both supported)
- The opencode-go provider key is already configured

Disable / Enable / Uninstall

  • Disable/Enable: Toggle dsh-opencode-go-usage-monitor on/off in the Plugins page
  • Uninstall: Remove the bundle from the Plugins page

Development Notes

If you modify client.js, a simple page refresh is enough for hot reload. However, if you modify index.js, the package name, or the loopback route, you must fully quit DSH Desktop and relaunch it; otherwise the page will request a route that the host hasn’t registered yet, resulting in HTTP 404.

Typical Usage

After installation, the panel appears automatically in the Harness panel area. Click the panel name to open the view and check the three quota tiers.

The sidebar icon displays the current quota summary in real time, without needing to open the panel first. Even when the panel is hidden, the plugin reads data in the background every 60 seconds.

Use Cases and Cautions

Who It’s For

  • DSH developers who frequently use the OpenCode Go plan
  • Users who need to check quota often but don’t want to switch to the model settings page
  • Anyone tracking the three-window (5h, weekly, monthly) usage

Notes

  1. The plugin runs with the permissions of the current dsh process. Please ensure you install it from a trusted source.
  2. It is recommended to review the source code and license (MIT) before installing.
  3. After modifying the plugin code, follow the troubleshooting instructions to restart or refresh.

Value Recap

This plugin makes OpenCode Go plan quota information readily accessible through a standalone panel and sidebar summary, while ensuring security by having the host fetch the key on behalf of the browser. For developers who need to check usage frequently, it can significantly improve workflow efficiency.

Directory: https://www.skillhub.cn/plugins/unhuman1146/dsh-opencode-go-usage-monitor

GitHub: https://github.com/unhuman1146/dsh-opencode-go-usage-monitor

羽毛球分组比赛记分
小程序二维码

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

Xiaoye