Introduction¶
DeepSeek Harness (DSH) masks differences between models through an adapter layer. However, when using Gemini’s native capabilities, the generic adapter layer performs structural standardization, causing some native fields to be dropped. This affects the continuity of multi-turn reasoning and can also trigger errors after mixing in native search. Additionally, DSH’s built-in reasoning tiers cap out at high, making it impossible to select the XHigh tier available on Gemini 4 Neon / Hydrogen. The community has also reported suspected degraded-intelligence routing on Gemini 4 when an English system prompt is used.
Plugin Overview¶
DreamAlone666/dsh-gemini-native is a Gemini /v1beta native API plugin for DSH. It reuses the built-in pi-ai adapter layer, does not replace model routing, and does not initiate additional model requests. Instead, it integrates the Gemini native capabilities and workaround options that DSH does not cover into the corresponding provider cards under Settings → Models for on-demand toggling. The plugin is maintained by DreamAlone666, categorized under Model Inference, and its GitHub repository is at dsh-gemini-native.
Core Features¶
- Native history replay: When
pi-aihandles multi-model compatibility, it standardizes history messages and discards certain Gemini native structures (thinking signatures, server-side tool records, and unknown fields). The plugin preserves thesepartsas-is and replays them faithfully while maintainingpi-ai’s streaming, attachment, and credential capabilities, and it alignsfunctionResponse.id. - Google native search: Eliminates the need to configure an external search source. It directly replaces the built-in
web_searchon the corresponding Gemini route with nativegoogleSearchwhile retaining other local tools. During search, a real-time indicator appears below the input box, and at the end of the turn, expandable search-query and source cards are displayed. - XHigh reasoning override: DSH’s built-in reasoning tiers top out at
high, making theXHightier on Gemini 4 Neon / Hydrogen inaccessible. The plugin adds a session-level quick toggle in the model menu without modifying the native tier setting. Once enabled, a status chip appears in the toolbar; click it to turn off. - System prompt localization (zh-CN): Replaces known DSH built-in English paragraphs with Simplified Chinese, leaving custom prompts and existing records untouched. The plugin matches and replaces paragraphs by comparing paragraph names against the built-in English source text.
- Status bar & real-time diagnostics: Most of the above capabilities operate silently under the hood. Below the input box, the currently active route items are displayed; expanding them reveals replay hits, search statistics, localized paragraph count, current reasoning tier, and any warnings.
Installation & Activation¶
Requires Node.js >=24.9.0 and DSH >=0.2.2-rc.2 <0.3.0.
- Open the DSH Web sidebar and navigate to Plugins → Add Plugin. Enter the repository URL directly to install and activate Gemini Native:
https://github.com/DreamAlone666/dsh-gemini-native.git
For a local source installation, clone the repository and install dependencies first, then enter the absolute directory path in “Add Plugin”:
git clone https://github.com/DreamAlone666/dsh-gemini-native.git
cd dsh-gemini-native
pnpm install
- Go to Settings → Models and expand any Gemini API provider card (supports the built-in
googleandgoogle-generative-airelay; does not support OpenAI-compatible or Vertex routes). Check the capabilities you need to activate them.
| Capability | Default | Location |
|---|---|---|
| Native history replay | On | Corresponding Gemini provider card |
| Status indicator below input box | On | Plugin detail page |
| Google native search | Off | Corresponding Gemini provider card |
| System prompt localization | Off | Corresponding Gemini provider card |
| XHigh reasoning override | Off | Gemini 4 Neon / Hydrogen session model menu |
Typical Usage¶
- Use native search: Under a Gemini route that supports native search, simply send a request to see the search indicator and source cards below the input box. No external search source configuration is needed.
- Switch to XHigh tier: Enable the XHigh reasoning override in the Gemini 4 Neon / Hydrogen session model menu. A status chip will appear in the toolbar; click it to disable.
- Check route status: Expand the status indicator below the input box to view current replay hits, search statistics, localized paragraph count, current reasoning tier, and any warnings.
Use Cases & Cautions¶
- Suitable for DSH users who need to preserve Gemini native structures, use Google native search, enable the XHigh tier, or avoid the risk of degraded routing caused by English system prompts.
- The plugin runs with the current DSH process permissions. Review the source code and license (MIT) before installing.
- Native replay writes the selected candidate’s native fields into session logs. Disabling the feature does not delete existing records; be mindful before exporting or sharing sessions.
- Native data and
pi-ainative signatures are stored separately. After deactivating the plugin, the original signatures remain fully functional. - Before uninstalling, if you plan to continue old sessions using the official model, first disable “Upload Session Log when using official model API” under Settings → General.
- When mixing Google native search with local tools, it is recommended to keep native replay enabled; otherwise, subsequent turns may throw errors.
- The plugin only replays history turns where the route, model, and prefix fingerprint all match (single-frame cap of 1 MiB, single-recording cap of 2 MiB; exceeding the cap skips recording without interrupting the response). Background compaction requests on the same route and model perform read-only prefix alignment to reuse the cache only—no recording, no card generation, and no
XHighinjection. - When an incompatible
toolConfigis present, search is not force-injected. When native replay is not enabled, search cards are retained only temporarily within the current Host process. XHighstate is persisted independently. On session fork, the current state is copied and then each fork operates independently. It is cleared when the model/tier is actively changed, manually turned off, or the session is archived.- Prompt localization requires an exact match between the paragraph name and the built-in English source text before replacement is applied.
Development & Testing¶
pnpm install
pnpm test
Offline integration tests load the real Cordis, Settings, Agent Loop, and pi-ai (network is mocked; current validation baseline is DSH 0.2.2-rc.2):
DSH_INSTALL_DIR=/path/to/node_modules/@deepseek-ai/dsh pnpm test:integration
Conclusion¶
By layering Gemini native capabilities on top of DSH’s generic adapter layer, this plugin lets users achieve a more faithful Gemini native API experience while keeping their existing workflows intact. See the dsh-gemini-native repository and the SkillHub plugin page for related resources and documentation.