Introduction

DeepSeek Harness (DSH) is designed with the philosophy that “everything is a plugin,” allowing users to extend model sources through plugins. CodeBuddy / WorkBuddy (Tencent code assistant) is a common local code assistant, but it is not included in DSH’s model selector by default. The dsh-codebuddy-models plugin reads the local login state and converts a CodeBuddy subscription into a native DSH provider, making it directly callable by agents.

Core Capabilities

This plugin mainly addresses the issue of directly using a local CodeBuddy subscription in a DSH environment. It provides the following capabilities:

  • Native provider integration: Integrated as a native provider for dsh; after enabling it, CodeBuddy models appear directly in dsh’s model selector.
  • Local credential reading: Reads local desktop client login credentials, does not perform login authorization, and does not store passwords.
  • Automatic token refresh: When a token is about to expire, it automatically calls the backend to refresh it.
  • Streaming: Supports SSE streaming.
  • Protocol compatibility: Compatible with the OpenAI chat-completions protocol and natively supports function calling / tool_calls.
  • Model scanning: Automatically scans the local CodeBuddy client’s product.json to obtain the model catalog.
  • Text models only: Supports only text models; image input is not supported.

Installation and Enablement

Installing this plugin requires that you are already logged in to the CodeBuddy / WorkBuddy desktop client; the plugin reads its local login files.

  1. Install the plugin:
    Use the dsh plugin command to add the plugin to the specified profile.
    dsh plugin --profile <profile名> add dsh-codebuddy-models
For example, install it to the web GUI profile:
    dsh plugin --profile web add dsh-codebuddy-models
  1. Make it effective:
    The install command executes pnpm add in the profile and appends the package to the dsh.profile.bundles stack. The model provider catalog is assembled when the process starts, so you must restart or refresh the GUI before the CodeBuddy provider and its models appear in the model selector.

Configuration

Configure the llm-codebuddy: section in $DSH_HOME/settings.yaml. All configuration options are optional and support hot changes.

llm-codebuddy:
  # 后端 origin,会拼接 /v2/chat/completions;留空/省略则用默认值 https://copilot.tencent.com
  baseURL: https://copilot.tencent.com
  defaultContextWindow: 1000000
  maxTokens: 64000
  streamIdleTimeoutMs: 300000
  models:
    - id: auto  # 回退目录(扫描不到官方目录时):默认仅 auto
  retryPolicy:
    mode: normal
    maxRetries: 5
  • baseURL: An empty string is equivalent to omitting it and falls back to the default endpoint https://copilot.tencent.com.
  • models: By default only auto. This catalog is only scanned at runtime, is not written to settings.yaml, and does not pollute user configuration.

How It Works

The plugin integrates with DSH through the CodeBuddyAdapter class and communicates with the Tencent backend using the standard OpenAI chat-completions protocol.

  1. Credential management:
    The plugin locates and parses the local login file (%LOCALAPPDATA%\CodeBuddyExtension\Data\Public\auth\*.info). When a token is about to expire, it automatically calls the backend to refresh it and writes the result back to the file.

  2. Model catalog:
    The plugin automatically scans the local CodeBuddy client’s product.json (with a 10-minute cache) and parses models available for chat. Capacity fields in the catalog are mapped to harness model capabilities and exposed to automatic context compression.

  3. Streaming and tool calling:

    • Streaming: Uses eventsource-parser to decode SSE and translates streaming data into StreamChunk objects returned to the agent.
    • Tool calling: The adapter handles CodeBuddy backend streaming behavior — the real tool name is only provided in the first tool-call delta, while in subsequent chunks function.name is an empty string. The adapter only overrides the tool name when it is non-empty, avoiding routing errors.
  4. Reasoning capability:
    The adapter declares four reasoning effort levels for each model: off / low / high / max (default high), and passes the request’s reasoningEffort through as reasoning_effort. The model must declare reasoning capability; otherwise the harness rejects the call.

Notes

  • Host version dependency: Depends on host version @deepseek-ai/dsh-llm ^0.1.2-rc.1. If the host is outside this range or is an alpha unstable snapshot, behavior may be abnormal.
  • Error mapping:
    • Enterprise quota limit errors (14012) are mapped to QUOTA errors and are not retried.
    • Model not allowed errors (11136) are mapped to MODEL_NOT_ALLOWED errors.
    • Not-logged-in errors are reported with a MISSING_CREDENTIAL hint.
  • Text models only: Image input is not supported.
  • Development mode: For local development and debugging, you can add a link dependency to the profile’s package.json and restart the GUI.

Catalog and Source

  • Plugin catalog: https://www.skillhub.cn/plugins/evlon/dsh-codebuddy-models
  • Source repository: https://github.com/evlon/dsh-codebuddy-models