Introduction

The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When connecting to model providers that are not natively supported, modifying DSH source code or relying on complex configuration is usually required. dsh-openai-responses-bridge is a standalone plugin that provides connectivity for third-party models to DSH through the OpenAI Responses protocol or the native Gemini Generative AI protocol. The plugin does not modify the DSH source tree and extends functionality through the plugin interface.

Core Features

The plugin mainly solves problems related to third-party model integration and protocol adaptation. Specifically, it includes:

  1. Third-party model integration: Add third-party providers that support the OpenAI Responses protocol without modifying DSH’s native provider list.
  2. Native Gemini support: Add native Gemini providers in the same bridge configuration area.
  3. Protocol compatibility and reuse: Reuse DSH/Pi’s native message conversion, reasoning processing, tool conversion, replay, usage statistics, and streaming error handling logic.
  4. Hosted search tools: Enable and display the remote Responses web_search tool, showing its lifecycle, query content, cited sources, and error information in a conversation card.
  5. Model discovery: Discover the model list from OpenAI-compatible /models endpoints and select it before saving the provider.
  6. Mode sharing: The same provider can be used in native mode and in Code Mode/PTC without registering a second dedicated search tool.
  7. Secure credential management: Store API keys through DSH’s credential store, keeping configuration files (YAML) free of plaintext secrets.
  8. Compatibility support: Include compatibility behavior for dsh-pwsh-sandbox-schem without requiring additional installation of a middleware plugin.
  9. Hot reloading: Support hot reloading provider settings without modifying the host source code.

Installation and Enablement

Before installation, ensure that DeepSeek Harness version is 0.1.2-alpha.2.

Use the DSH plugin manager to install the specified plugin version:

dsh plugin --profile web add 'github:DaoCaoRenH/dsh-openai-responses-bridge#<commit-sha>'

After the plugin is loaded, its internal ID is llm-openai-responses-bridge. A “Third-Party Models” configuration area appears in the settings interface.

How It Works

Protocol Routing

The plugin provides routing support under the llm-openai-responses-bridge namespace, divided into two protocols:

  • OpenAI Responses (Bridge): Convert requests to the OpenAI Responses POST /responses endpoint.
  • Google Generative AI: Convert requests to the native Gemini generateContent endpoint.

Request Flow

For OpenAI Responses routing, the plugin performs the following operations:

  1. DSH/Pi constructs a standard request containing the conversation, reasoning settings, local tools, and model configuration.
  2. The plugin removes the max_output_tokens field because some third-party gateways do not accept this field.
  3. If hosted search is enabled, the plugin appends the configured Responses hosted tool (default is web_search) and sets it to auto when tool_choice is not set, to request search sources.
  4. Only on the hosted search path is the local web_search Function Tool removed; other local tools are retained.
  5. Pi continues to parse messages, reasoning, tool calls, usage, and error data from the streaming response.

Code Mode / PTC

In Code Mode or PTC, the plugin does not register an additional web_search_openai tool. The plugin observes nested tools.web_search() dispatch and, for enabled Bridge OpenAI Responses routing, sends a minimal hosted request and returns the result in DSH’s native web_search format (content, sources, truncated), preserving the SDK contract unchanged.

Credential Storage

API keys are written through DSH’s credentials.set interface. In YAML configuration, apiKeyEnv is used as a credential reference; the field itself is not a secret value.

Typical Usage

OpenAI Responses Configuration

For OpenAI Responses routing, baseURL must be an absolute HTTP(S) URL and must not include the /responses suffix. The plugin automatically appends this suffix when making requests.

Example:

baseURL: https://api.example.com/v1

Gemini Configuration

For Gemini routing, the native API version path must be included.

Example:

baseURL: https://generativelanguage.googleapis.com/v1beta

Notes

  1. Version dependency: The current version strictly depends on the DeepSeek Harness 0.1.2-alpha.2 API.
  2. Field handling: The plugin does not inject search system prompts, nor does it rewrite native request fields such as max_tokens, text, reasoning, parallel_tool_calls, and client_metadata.
  3. Source code modification: The plugin does not modify the DeepSeek Harness source tree.
  4. Permissions and security: Hosted search events are converted to Bridge session events and displayed in a card. The plugin does not actually fetch or execute the discovered source URLs; it only displays their metadata.