OpenDesign CoRouter Plugin: Dual Providers for Plans and Billing Models with Four-Tier Quota Monitoring in DSH

Introduction

DeepSeek Harness (DSH) adopts a plugin-based architecture, making it suitable for running agent projects locally that require access to official APIs or desktop login sessions. Plugins must properly handle quotas and login state, and conform to DSH Core’s interfaces and lifecycle. This article introduces KouzakiUmi’s dsh-opendesign-corouter plugin, which provides dual providers, a four-tier quota display, desktop-login-first with standalone login capability, and anomalous end-of-turn detection for DeepSeek V4.1 Flash for CoRouter models.

What It Is

dsh-opendesign-corouter is a model inference plugin for DeepSeek Harness, used to connect to the OpenDesign CoRouter service. The plugin divides models into two providers: “Plan Inclusion” and “Paid Models,” displays four tiers of quota information (plan inclusion window, plan balance, top-up/gifted credits, and total quota), supports desktop login state as the preferred source with standalone login as a fallback, and provides anomalous end-of-turn detection for DeepSeek V4.1 Flash. The plugin is maintained by KouzakiUmi and is installed and configured through the DSH plugin mechanism.

Installation and Activation

Install via DSH:

dsh plugin --profile web add dsh-opendesign-corouter

You can also download the build artifacts (.tgz and .sha256) from GitHub Actions and install the local package:

dsh plugin --profile web add /absolute/path/to/dsh-opendesign-corouter-0.3.5.tgz

Activation and reloading after installation follow the target DSH instance’s management workflow.

Configuring Connection and Login

  1. Open Settings → OpenDesign CoRouter → Connection & Login.
  2. Click “Start Device Authorization” to automatically open the official authorization page in a temporary Chrome window. Review and confirm. You can also use “Open Authorization Page in New Window” or copy the link to your preferred browser.
  3. Return to the settings page and wait for the save to complete successfully. Quota defaults to reading from the desktop login state first; to explicitly use the device-authorized account, you can disable desktop-first.
  4. Go back to the model selector and choose “OpenDesign CoRouter · Plan Inclusion” or “OpenDesign CoRouter · Paid Models.”

Device authorization simultaneously obtains two types of tokens: one for quota queries and one for official gateway inference. An explicitly configured API Key still takes precedence.

Model Groups and Default Parameters

The plugin provides two built-in providers:

  • opendesign-corouter-plan: Models actually covered by the current workspace subscription.
  • opendesign-corouter-paid: Models not included in the Coding Plan or whose entitlements have not yet been verified; each row is explicitly labeled.

The plugin ships with 46 conversation IDs as reference. At runtime, it reads the catalog from the current gateway and uses the control token from the same authorized identity to perform per-model workspace pre-checks. Initial load and a refresh after ten minutes are performed as needed; manual refresh is also available. If a plain API Key cannot be matched to an account token, desktop account entitlements are not borrowed and no free inclusion is assumed. Enable or disable individual models, control image input, and configure temperature, top-p, output, context, thinking, and protocol; unknown capabilities are left as unknown.

Context windows generate three tiers—default, extended, and maximum—based on model capacity. For example, 1M yields 256K / 512K / 1M, and 262,144 yields 65,536 / 131,072 / 262,144. The maximum tier uses the full verified reference for that model. All three tiers represent the combined input-plus-output working window; unknown capacity does not fabricate a maximum. Output is reserved within the window, with the automatic reservation capped at 1/4 of the total window and not exceeding the model’s output limit.

Capacity tiers are displayed directly beside the chat model selector for one-click switching; the settings page uses the same control. Context, thinking control, and maximum output are directly visible on the model row, while protocol, temperature, Top P, and full pricing are tucked into advanced parameters. Both entry points write to the same global model defaults, so other sessions using the same model will pick up changes in sync.

The inference protocol defaults to automatic selection per model: GPT / DeepSeek use Responses, Claude uses Messages, and the rest are selected based on precise model-type evidence; when native routing is unconfirmed, Responses is used. Both global and per-model settings can explicitly override the default, and previously saved legacy protocols remain in effect. Internal gateway passthrough has not been verified, so local protocol selection should not be treated as a no-translation guarantee. Model discovery always reads the OpenAI-compatible /models endpoint.

Thinking control is differentiated by precise model type and actual protocol: 35 models have intensity levels, MiMo (2 models), Qwen3.7 Max, and Hy4 (3 models) offer verified on/off toggles, Kimi K2.7 Code displays fixed thinking, and 4 models with unverified capabilities are explicitly noted. The toggle does not masquerade as intensity; the four standard DeepSeek models get a supplementary off option. Adjustable models send values based on sourced defaults; legacy invalid settings remain clearable.

Four Tiers of Quota, No Double Counting

The plugin displays four tiers of quota:

  • Plan Inclusion Window: Each shows used, remaining, and reset time.
  • Plan Balance: Available amount in the subscription pool.
  • Top-up / Gifted Credits: Available amount in the corresponding wallet pool.
  • Total Quota: The total balance as reported by the API; per-pool figures are not added on top of this again.

When the API is missing or permissions are insufficient, “Unknown” or “Partially Available” is shown rather than filling in 0. Window reset, subscription billing cycle end, and next automatic refresh are displayed separately. If the desktop channel only has partial quota and a complete standalone session already exists, the plugin switches entirely to the standalone session and labels the source; it does not stitch together account data. The quota identity and the inference Key’s account/workspace must remain consistent.

Desktop-First with Standalone Login Support

After clicking “Start Device Authorization,” the plugin opens the official authorization page in a temporary Chrome window. You can also use “Copy Authorization Link” to complete confirmation in your preferred browser; if copying is unavailable, a selectable link is displayed. After confirmation, the authorization is saved automatically. On cancellation or expiry, the wait ends and the temporary window is closed.

DeepSeek V4.1 Flash Anomalous End-of-Turn Detection

Both features apply exclusively to the DeepSeek V4.1 Flash tool conversations in this plugin’s Plan Provider; other models and providers are unaffected. Protocol protection is an independent toggle, enabled by default; end-of-turn verification is a separate toggle, disabled by default. Protocol protection follows dsh-empty-turn-guard, marking only “stop with no tool calls, empty response, or residual protocol fragments” as anomalous EOT. Operational preambles containing normal content are preserved as successful responses and the original request is no longer resent based on sentence patterns.

Anomalous EOT triggers continuous retries within the same step until success or cancellation; other errors follow the host policy. With end-of-turn verification enabled, the Agent appends bounded verification upon completion: up to 3 steps by default, stopping after 2 consecutive steps with no new successful tool results; adjustable in the advanced page. The model reports completion, awaiting user input, awaiting background work, blocked, or continuing execution; when tool work has been done, completion claims must reference successful results. Existing unfinished Goals, background waits, cancellations, and truncations retain their original controls. The initial end-of-turn verification typically adds one model step; reference validation does not constitute independent proof that all task requirements have been met.

Before You Get Started

  • Quota data comes from official services and the desktop client; some interfaces may change with upstream updates. Actual billing is subject to the console and invoices.
  • Credential storage: API Keys and device authorizations are saved by the DSH credential service. At-rest protection depends on the host and local permissions; see SECURITY.md for details.
  • Verification status: Real device authorization, model catalog reading, and per-model billing pre-checks have been completed, along with type checking, isolated loading, offline UI, and theme checks. Real inference and full integration testing with an installed Profile are still pending verification.

Compatibility

  • Target DSH Core: 0.2.1-rc.3, verified against the official release of the same version.
  • Core declared range: >=0.2.1-rc.3 <0.2.2-0 || >=0.2.2-0 <0.3.0-0, with pre-release lower-bound branches for each 0.2.x minor. Other versions within the range do not imply tested compatibility.
  • Node.js: >=24.9.0.
  • Standalone login: Auto-open requires local Chrome; you can also copy the link to your preferred browser to confirm.
  • Default inference endpoints: Auto-selected per model—/v1/responses, /v1/messages, or /v1/chat/completions.

Development and Build

git clone https://github.com/KouzakiUmi/dsh-opendesign-corouter.git
cd dsh-opendesign-corouter
npm ci --ignore-scripts
npm run check
npm run test:ui

Local UI tests require Chrome; pages use mock data and block network access. The source checkout does not include pre-built lib; run the build first before installing from a local directory.

Documentation and Feedback

Usage Guide · Troubleshooting · Changelog · Security Boundaries · Third-Party Notices

When filing issues via Issues, please include the plugin version, DSH Core version, and a redacted error description. Do not paste API Keys, Cookies, credential files, or URLs containing secrets.

This project is licensed under MIT. Upstream copyright notices are listed in THIRD_PARTY_NOTICES.md. Version tags are published to npm via GitHub OIDC trusted publishing; see the release notes for the process. This project has no official affiliation with OpenDesign or DeepSeek.

Use Cases and Caveats

Suitable for DSH users who need to connect to OpenDesign CoRouter, clearly view plan inclusion and wallet balances, and require desktop login state or standalone login. The plugin runs with the current DSH process’s permissions; review the source code and license before installation.

Conclusion

Through its dual-provider architecture and four-tier quota display, this plugin helps DSH users gain a more intuitive grasp of resource usage when developing and debugging CoRouter models. See the catalog page and GitHub repository below.

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

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

Xiaoye