dsh-local-codex:给单次 DeepSeek Harness 会话接上本地 Codex

Introduction

DeepSeek Harness (DSH) is an agent development environment where “everything is a plugin”. Developers often wish to invoke the locally running Codex CLI directly within a single session, rather than having to paste context back and forth between the chat window and the terminal. dsh-local-codex provides a way: it allows a specific DSH session to be hosted by the local Codex. Its responses, command executions, and file changes are presented via DSH’s native tool cards, keeping the conversation on the same timeline.

What is it?

dsh-local-codex is a Host plugin for DeepSeek Harness, maintained by Anzerwhite. It hands off a single DSH session to the local Codex CLI via codex app-server and uses Codex’s configuration file (~/.codex/config.toml), requiring no re-login or account switching. This mode is session-based; new sessions and branches are disabled by default, and the same Codex thread can be restored after restarting DSH.

Core Features

  • Session takeover: Toggle Codex mode for a single session via trigger phrases or /codex on/off/status, while other sessions remain in normal DSH model and tool mode.
  • Streamed responses and tool cards: Codex’s text flows through DSH’s assistant stream. Command executions, file changes, MCP calls, and searches are presented as collapsible tool cards.
  • Local runtime environment: Uses local Codex configuration, supporting providers, models, hooks, skills, and plugins under the same configuration.
  • Thought intensity control: Offers five levels: minimal / low / medium / high / xhigh, passed from DSH to Codex for every round (max maps to xhigh).
  • Session persistence: Mode state and Codex thread ID are stored in the session, restoring the same thread after restarting DSH.
  • Permission and sandbox mapping: DSH’s session sandbox/approval presets are mapped to Codex’s sandboxPolicy and approvalPolicy for each round. Codex’s approvals are presented via DSH’s approval cards.
  • Stop and resume: Stop interrupts the current Codex round and retains partial output; failures display an error and rebuild the app-server.
  • Thread release: /codex off unsubscribes from the Codex thread, immediately unloads the app-server, and allows the native Codex to reopen that session.
  • Attachment handling: Images in the Composer are converted to localImage input, files are generated on disk and passed to Codex.

Installation and Enablement

Install the plugin (using the official tarball):

dsh plugin --profile web add https://github.com/Anzerwhite/dsh-local-codex/releases/download/v0.1.0/dsh-local-codex-0.1.0.tgz

After installation, restart or reload the DSH web profile.

Trigger Phrases and Commands

Sending the following content in a session enables or disables Codex mode (without entering the model’s conversational flow):

  • Enable (empty content):
  • Chinese: 使用codex模式 / 开启codex模式 / 进入codex模式 / 切换到codex模式
  • English: use codex mode / enable codex mode / enter codex mode / codex mode on
  • Enable with content attached:
  • 使用codex模式:帮我修复这个测试 (Use codex mode: help me fix this test)
  • Disable:
  • Chinese: 退出codex模式 / 关闭codex模式 / 结束codex模式
  • English: exit codex mode / disable codex mode / codex mode off
  • Explicit control:
  • /codex on · /codex off · /codex status

After enabling, the session’s model and tools are taken over by Codex. Responses stream into the chat, and tool operations are presented as tool cards.

Typical Usage

  1. Install the plugin and restart/reload the DSH profile.
  2. Open a session and use the DSH model normally.
  3. Send “Use codex mode: run the unit test, and fix it if it fails”.
  4. DSH confirms Codex mode is enabled and switches to local Codex.
  5. Codex executes the test, displaying the exit code via a tool card if it fails, rerunning after the fix, and finally completing the loop within the conversation.

Use Cases and Notes

Suitable for developers who need to integrate Codex into the DSH workflow and wish to avoid context pasting and account switching. The following conditions must be met before use:
- DSH Version: 0.2.1-rc.x (Host-only plugin, no client bundle).
- Codex CLI: 0.170.x (Default path /root/.npm-global/bin/codex, other platforms need to configure via codexBin).
- Codex Configuration: Uses ~/.codex/config.toml, supports custom providers; if login is required for the provider, execute codex login yourself.
- Package Manager: DSH plugin manager will use pnpm to install the zod dependency, ensure the profile is accessible.

This plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license (MIT) before installation.

Summary

dsh-local-codex allows a single DSH session to be directly hosted by the local Codex, keeping the conversation and tool actions in the same stream. For installation and more details, visit:
- Plugin Directory Page: https://www.skillhub.cn/plugins/Anzerwhite/dsh-local-codex
- GitHub: https://github.com/Anzerwhite/dsh-local-codex

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye