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:
- Third-party model integration: Add third-party providers that support the OpenAI Responses protocol without modifying DSH’s native provider list.
- Native Gemini support: Add native Gemini providers in the same bridge configuration area.
- Protocol compatibility and reuse: Reuse DSH/Pi’s native message conversion, reasoning processing, tool conversion, replay, usage statistics, and streaming error handling logic.
- Hosted search tools: Enable and display the remote Responses
web_searchtool, showing its lifecycle, query content, cited sources, and error information in a conversation card. - Model discovery: Discover the model list from OpenAI-compatible
/modelsendpoints and select it before saving the provider. - Mode sharing: The same provider can be used in native mode and in Code Mode/PTC without registering a second dedicated search tool.
- Secure credential management: Store API keys through DSH’s credential store, keeping configuration files (YAML) free of plaintext secrets.
- Compatibility support: Include compatibility behavior for
dsh-pwsh-sandbox-schemwithout requiring additional installation of a middleware plugin. - 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 /responsesendpoint. - Google Generative AI: Convert requests to the native Gemini
generateContentendpoint.
Request Flow¶
For OpenAI Responses routing, the plugin performs the following operations:
- DSH/Pi constructs a standard request containing the conversation, reasoning settings, local tools, and model configuration.
- The plugin removes the
max_output_tokensfield because some third-party gateways do not accept this field. - If hosted search is enabled, the plugin appends the configured Responses hosted tool (default is
web_search) and sets it toautowhentool_choiceis not set, to request search sources. - Only on the hosted search path is the local
web_searchFunction Tool removed; other local tools are retained. - 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¶
- Version dependency: The current version strictly depends on the DeepSeek Harness
0.1.2-alpha.2API. - 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, andclient_metadata. - Source code modification: The plugin does not modify the DeepSeek Harness source tree.
- 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.