Introduction

The DSH web profile allows loading extension components in the chat interface. When using an OpenCode Go subscription, it’s not easy to consistently monitor the remaining ratios and reset times for the three usage windows: 5-hour rolling, weekly, and monthly, on the interface. Issues are often discovered only when the window is about to be exhausted and requests are rate-limited.

The following introduces dsh-opencode-go-usage. It is a DSH bundle that displays the OpenCode Go subscription usage in the composer dock of the DeepSeek Harness web GUI, located above the input box.

What Is This

dsh-opencode-go-usage is maintained by v587d for the DSH web profile. Its purpose is specific: to add a usage chip in the chat interface, showing the percentages and reset countdowns for the three windows (5-hour rolling, weekly, and monthly) above the input box.

It is not a core component of DSH, nor does it replace OpenCode Go’s account management. It only provides usage viewing, threshold alerts, and credential configuration entry within the current DSH web interface.

Core Features

Three Usage Windows

Displays the percentages and reset countdowns for the three windows: 5-hour rolling, weekly, and monthly. When a window approaches its limit, you can see the remaining time in advance, rather than reacting after requests are rate-limited.

Color by Threshold

Status is color-coded by threshold:

  • Normal
  • Yellow Warning: ≥80%
  • Red Error: ≥90% or already rate-limited

Data Freshness

The chip shows the time of the last successful fetch in the format upd HH:MM. This allows you to see if the data is still valid.

Polling and Caching

The plugin polls every 10 seconds and refreshes immediately when switching back to the tab. The host side has a 300-second cache with a configurable TTL; after failure, there is a 60-second cooldown to avoid frequent requests.

Provider Awareness

It only displays when the current session’s model uses the opencode-go provider. It automatically hides when switching to other providers and reappears when switching back.

Details Panel and Manual Refresh

Clicking the chip expands the details panel. In the panel, you can see the reset countdown for each window and perform a manual refresh.

Built-in Set Credential Editor

In the bottom-left corner of the details panel, there is a Set entry to configure the workspace id and cookie. Set values are displayed in masked form, so there’s no need to view the full credentials directly.

Graceful Degradation

If configuration is missing or an HTTP failure occurs, the plugin enters a degraded state. Clicking the chip in this state takes you directly to the Set panel to handle credential configuration.

The cookie is only used on the host side. The browser only accesses same-origin JSON endpoints and does not send the cookie to the browser.

Installation and Activation

Prerequisites before installation:

  • DeepSeek Harness 0.1.0-rc.6 or newer, using the web profile.
  • pnpm is available in the PATH.

First, run the installation command to add the plugin to the web profile:

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

After installation, restart dsh web and refresh the page. Once done, the chip will appear in the dock above the input box.

If you only want to verify whether the plugin layer is composed, you can run:

dsh --profile web --dump-config

This step checks the current plugin composition for the web profile without needing to open the browser page first.

Typical Usage

Configure Credentials in the Interface

  1. Click the chip in the dock above the input box.
  2. Expand the details panel.
  3. Click Set in the bottom-left corner.
  4. Enter the workspace id and cookie.
  5. Click outside, press Esc, or save to confirm.

The configuration takes effect immediately. Credentials in the editor are displayed in masked form and are not exposed as full strings.

Use Environment Variables

You can also provide credentials via environment variables:

export OPENCODE_GO_COOKIE="<cookie>"
export OPENCODE_GO_WORKSPACE_ID="<workspace-id>"

Environment variables have higher priority than the configuration file.

Use Configuration File

You can also write credentials to a configuration file:

$DSH_HOME/ocgo-usage.json

The default path is:

~/.dsh/ocgo-usage.json

After writing, it’s recommended to set file permissions:

chmod 600 ~/.dsh/ocgo-usage.json

Configuration priority is: environment variables > configuration file > built-in defaults.

Optional Overrides

You can override certain behaviors using the following environment variables:

OPENCODE_GO_BASE_URL
OPENCODE_GO_CACHE_TTL
OPENCODE_GO_TIMEOUT_MS

Among them, OPENCODE_GO_CACHE_TTL adjusts the host-side cache TTL. The enabled setting in the composition layer configuration is the master switch, defaulting to true.

Applicable Scenarios and Notes

This plugin is suitable for users who use the OpenCode Go subscription in the DSH web profile. If you want to continuously monitor the 5-hour, weekly, and monthly usage near the input box and detect threshold increases early, it can serve as a lightweight entry point.

Note that cookie is the OpenCode Go session credential. It is a full user session that can access all workspaces, subscriptions, and billing information within the account and should be treated like a password.

The plugin does not log cookies or send them to the browser. The configuration editor only writes new values to:

$DSH_HOME/ocgo-usage.json

If the cookie expires or is revoked, the page will redirect to the login page with a 302 status, and the chip will display:

<err:http302>

After re-logging in, you can update the cookie via the Set panel.

Before installation, it’s recommended to check the source code and license. The plugin runs with the current DSH process permissions and is licensed under MIT.

Related Links

Directory page:

https://www.skillhub.cn/plugins/v587d/dsh-opencode-go-usage

GitHub repository:

https://github.com/v587d/dsh-opencode-go-usage