Introduction

DeepSeek Harness (DSH) uses a plugin-based architecture, allowing developers to integrate various LLMs through adapters. When connecting to Tencent CodeBuddy, browser OAuth login, token renewal, and model list synchronization usually require manual handling. The dsh-codebuddy-auth plugin integrates CodeBuddy (IOA) into DSH’s model selector through a native ctx.llm adapter, providing an out-of-the-box integration experience.

Plugin Overview

dsh-codebuddy-auth is a plugin that uses Tencent CodeBuddy (IOA) as a native LLM provider for DeepSeek Harness.
* Maintainer: cainiao1992
* Purpose: Model inference
* License: MIT
* Core capabilities: Browser OAuth login, automatic token refresh, credential storage, /v3/config model synchronization, and native adapter support.

Core Features

The plugin implements a complete CodeBuddy integration path:
* Native adapter: Registered on ctx.llm and takes over request routing.
* Browser login: Supports OAuth authentication through a browser.
* Automatic refresh: Implements a three-stage automatic refresh mechanism (startup check, 30-minute runtime check, and refresh triggered when a token expires).
* Model discovery: Retrieves the model list and inference capability metadata through the /v3/config endpoint.
* Streaming: Supports SSE streaming responses and message serialization.
* Reasoning effort: Each model exposes its actual supported reasoning efforts (supportedEfforts).

Installation and Enablement

DSH installs plugins through the official dsh plugin CLI. Ensure your environment meets the requirements before installing.

Environment Requirements

  • pnpm must be available in PATH.
  • Node.js version must be >= 18.12.

Installation Command

Run the following command to install the plugin:

dsh plugin --profile web add github:cainiao1992/dsh-codebuddy-auth

Restart DSH after installation. The plugin registers the codebuddy provider at startup.

Usage

After installation and restart, CodeBuddy models appear in the model selector.

Basic Operations

  • Switch model: Select any model under CodeBuddy in the model selector (for example, deepseek-v4-pro).
  • Check status: Send check codebuddy status in the conversation.
  • Refresh credentials: The plugin automatically handles token refresh. If credentials become invalid, send refresh codebuddy to trigger a manual refresh, or log in again.
  • Sync models: When Tencent updates the model list, send sync codebuddy models.
  • Log out: Send log out of codebuddy to clear the stored credentials.

Reasoning Effort Configuration

The plugin displays each model’s reasoning effort levels based on the metadata returned by /v3/config. For example:
* deepseek-v4-pro: Supports low / high / xhigh.
* glm-5.2: Defaults to high and supports multiple effort-level selections.
* Fixed inference models (for example, glm-5.1) only display their default level.

Technical Details and Configuration

Dual-Identity Mechanism

To work around authentication restrictions, the plugin uses different identity identifiers for different endpoints:
* Chat endpoint (POST /v2/chat/completions): Uses the CLI client identity (User-Agent: CLI/2.96.0 CodeBuddy/2.96.0) to avoid being blocked by IDE authentication.
* Model discovery (GET /v3/config): Uses the Craft / VSCode identity (X-Agent-Intent: craft) to retrieve each model’s supportedEfforts and defaultEffort metadata.

International Edition Support

By default, the plugin connects to the mainland China edition. To connect to the international edition, configure edition: intl in the mount entry of cordis.patch.yml.

Notes

  • Runtime environment: The plugin runs with the permissions of the current DSH process. Make sure you trust the plugin’s source code.
  • Dependency requirements: Both installation and CLI login depend on Node.js >= 18.
  • Endpoint restrictions: The chat endpoint requires stream: true; otherwise it returns code 11101. The model discovery endpoint must include the Craft/VSCode identity header to retrieve complete metadata.

Summary

dsh-codebuddy-auth simplifies the otherwise cumbersome process of integrating Tencent CodeBuddy into DSH. Through its native adapter and automated token management, it enables developers to use CodeBuddy’s model resources directly. For the related directory and source code, refer to the links below.