Introduction¶
The DeepSeek Harness (DSH) ecosystem extends functionality through plugins. When using the official dsh-llm-pi-ai adapter, if a model declares reasoning capabilities, the system rewrites the system prompt to use OpenAI’s developer role. Many third-party OpenAI-compatible endpoints (for example, Tencent CodeBuddy) do not support developer messages, which can cause requests to be rejected or to trigger content_filter, while requests using the system role work normally. The dsh-plugin-thinking-api plugin is intended to resolve this compatibility issue.
Plugin Purpose¶
This plugin is used to configure any OpenAI-compatible API with one click and automatically enable thinking mode, while avoiding rejection by third-party endpoints that do not support the developer role. The author is qjf44, and the license is MIT. Its core logic reuses the official PiAiAdapter class, but injects compat.supportsDeveloperRole: false when building models, thereby forcing requests to use the system role.
Core Features¶
- One-click configuration: There is no need to manually write internal fields such as
reasoningEffortsorthinkingFormat; you can directly configure the generic OpenAI format. - Thinking mode: Set
thinking: truein the model configuration to automatically enable reasoning levels. - Fix role rejection: Resolves the issue where unofficial whitelist endpoints reject requests due to the
developerrole when reasoning is enabled.
Installation and Enablement¶
In the DeepSeek Harness Profile configuration directory, modify package.json. Add the plugin dependency in dependencies and register it in dsh.profile.bundles.
// ~/.dsh/profiles/<profile>/package.json
{
"dependencies": {
"dsh-plugin-thinking-api": "github:qjf44/dsh-plugin-thinking-api"
},
"dsh": {
"profile": {
"bundles": [
"dsh-plugin-thinking-api"
]
}
}
}
After installation is complete, restart Harness. The plugin is automatically registered through cordis.patch.yml, with no manual configuration changes required.
Typical Usage¶
Configuring via YAML¶
Add a thinking-api configuration block to ~/.dsh/settings.yaml.
thinking-api:
providers:
codebuddy:
displayName: CodeBuddy
baseURL: https://copilot.tencent.com/v2
apiKeyEnv: CODEBUDDY_API_KEY
thinkingFormat: deepseek
models:
deepseek-v4-pro:
name: DeepSeek V4 Pro
thinking: true
Using the Web UI Wizard¶
- Open the Settings menu and find the Thinking API panel.
- Select a template (such as CodeBuddy) or customize it.
- Enter the API Key.
- Click Fetch models to list the endpoint models (Tencent CodeBuddy will use the template default models if it does not have this endpoint), select the models to enable, and set
thinking: true. - Save.
Note: The client portion of the Web UI is imported through
exports["./client"]. After modifying the plugin source code, the Web build package needs to be rebuilt to make the new client effective.
Configuration Reference¶
Provider Configuration¶
baseURL: The API endpoint address (required).apiKeyEnv: The environment variable name that stores the key.thinkingFormat: The reasoning format, defaulting todeepseek.models: The model configuration dictionary.
Model Configuration¶
thinking: A boolean value; set totrueto enable thinking mode.input: Declares input modalities, such as["text", "image"]; otherwise, it defaults to text-only.
Applicable Scenarios and Notes¶
This plugin is suitable for scenarios that use unofficial PiAiAdapter whitelist endpoints (such as Tencent CodeBuddy or self-hosted vLLM) and need to enable reasoning functionality.
Prerequisites:
- The DeepSeek Harness version must be between 0.1.0-rc.6 and 0.1.5-rc.1, or a higher compatible version.
- It depends on the official @deepseek-ai/dsh-llm-pi-ai library.
Notes:
- The Web UI requires rebuilding the client build package to recognize the plugin’s new features.
- The plugin runs with the current DSH process permissions. Please confirm the source code and license before use.
Conclusion¶
dsh-plugin-thinking-api is a lightweight tool that focuses only on injecting the missing compatibility field without changing the core logic of the official adapter. For developers who need to enable thinking mode on non-standard endpoints, this is a necessary supplement.