Introduction¶
DeepSeek Harness (DSH) extends its capabilities through a plugin mechanism. dsh-llm-codex is a community-maintained plugin designed to register Codex CLI as an LLM provider for DSH. It does not rely on official DeepSeek releases but intervenes through a mount layer, primarily addressing the need to directly invoke local Codex or use OpenAI-compatible interfaces within DSH.
What it is¶
This is a Codex routing plugin:
* Core Logic: Prioritizes using the locally installed Codex CLI to initiate requests; if the local CLI is unavailable or a fallback is configured, it uses an OpenAI-compatible API.
* Positioning: It exposes Codex as a text generation router, rather than a complete Agent. It does not execute DSH’s tool calls, nor does it pass Codex’s internal tool calls back to DSH.
* Maintainer: zhangzhangco.
Core Features¶
- LLM Provider Registration: Registers a provider named
codex-localby default. - Local Priority: Executes requests locally via the
codex execcommand, reusing the existing Codex login state on the machine (no API key required). - OpenAI-Compatible Fallback: Supports configuring OpenAI-compatible interfaces as an alternative.
- Model Catalog: Reads the model list from Codex’s cache file
$CODEX_HOME/models_cache.jsonand synchronizes its context window and reasoning level information. - Sandbox Support: Supports Codex’s native sandbox modes (read-only, workspace-write, full access), mounted via
dsh.bundle.patch.
Installation and Activation¶
This plugin is installed via a Git repository and mounted to the web configuration profile. Run the following command to complete the installation:
dsh plugin --profile web add git+ssh://git@github.com/zhangzhangco/dsh-llm-codex.git
After installation, restart the web configuration profile, and the Codex router will appear in the model selector.
Configuration and Sandbox¶
The plugin configuration is mounted via cordis.patch.yml, with key parameters as follows:
- insert:
- id: llm-codex
name: dsh-llm-codex
config:
provider: codex-local
sandbox: read-only
transport: auto
fallback:
baseURL: ''
apiKeyEnv: CODEX_FALLBACK_API_KEY
Sandbox Mode Description¶
The plugin’s sandbox parameter controls the Codex native sandbox, which is independent of DSH’s permission management.
- read-only (default): Read-only mode, rejects all file writes.
- workspace-write: Allows writing files within the session workspace.
- danger-full-access: Full access mode, does not use the Codex sandbox.
Notes:
* macOS Limitations: read-only and workspace-write modes require macOS Seatbelt (via sandbox-exec); otherwise, they will fail.
* Nested Sandbox Issues: If the host is already running in a sandboxed environment (e.g., Docker container or system-level sandbox), it is impossible to create new nested sandboxes. In this case, all sandboxed modes will reject writes, and only danger-full-access can be used.
Enabling Fallback Interface¶
To enable the OpenAI-compatible fallback interface, you need to specify the baseURL and environment variable name in the configuration:
fallback:
baseURL: https://api.openai.com/v1
apiKeyEnv: OPENAI_API_KEY
The plugin prioritizes reading the variable value from the credential store; if not found, it reads from the process environment variables.
Use Cases and Notes¶
- Use Cases: When you need to utilize the capabilities of Codex CLI within DSH, or require an OpenAI-compatible local/remote endpoint as a model provider, this plugin provides a convenient routing layer.
- Notes:
- The plugin is an npm package intentionally marked as
private: trueand will not be published to npm; it is distributed solely via GitHub. - It uses Codex’s sandbox boundaries, so please choose the
sandboxlevel carefully based on the host environment (especially macOS or container environments). - Please check the source code and license (MIT) before installation.
- The plugin is an npm package intentionally marked as