返回目录
模型与 MCP 插件

dsh-codex-mode

TideDra/dsh-codex-mode

1:1 OpenAI Codex CLI agent preset for DeepSeek Harness — GPT-6 CodeMode, Direct tools, V4A fuzzy patch editing, unified PTY execution, and Multi-Agent V2 with an Ultra toggle.

Stars
0
Forks
0
Issues
0
更新
7 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:TideDra/dsh-codex-mode

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-codex-mode

English | 简体中文

A 1:1 verbatim replica of the OpenAI Codex CLI (codex-rs 0.164.0) agent harness packaged as an isolated DeepSeek Harness (DSH) Agent Preset bundle (preset-codex) and isomorphic CLI headless overlay (headless.patch.yml).

Installing this bundle adds a first-class Codex preset alongside Standard and Creator — with zero modifications to global model selectors or other presets.


Key Features

  • Model-Aware Dual Tool Modes (CodeModeOnly & Direct):
    • GPT-6 / GPT-5.6 (CodeModeOnly): Exposes Codex's async JavaScript orchestration cell (exec, wait, sleep, request_user_input, request_user_input_async) with nested tools.exec_command, tools.write_stdin, tools.apply_patch, tools.view_image, and tools.clock__curr_time — enabling single-step Promise.all parallel reads and edits.
    • General Models (Direct Mode): Automatically routes non-CodeMode models (DeepSeek, Claude, Gemini, GPT-5.5, etc.) to Codex's clean orthogonal direct toolset (exec_command, write_stdin, apply_patch, view_image) + verbatim prompt.md.
  • *Multi-Agent V2 (`collaboration.) + ScopedUltra` Switch (Default ON)**:
    • Full implementation of spawn_agent (fork_turns: "all" | "none"), send_message, followup_task (cold-resume), wait_agent (bidirectional parent/child/sibling wake), interrupt_agent, and list_agents with automatic non-blocking step-boundary mailbox draining (agent/pre-step).
    • Renders a dedicated ⚡ Ultra pill switch in the DSH Web composer bar exclusively when the Codex preset is active (default ON, toggleable via UI click or /ultra [on|off|status]).
  • Unified PTY & Pipe Execution (exec_command + write_stdin):
    • Supports both clean pipes (tty: false) and real interactive node-pty sessions (tty: true), 10 non-interactive anti-hang environment variables (UNIFIED_EXEC_ENV), bundled @vscode/ripgrep (rg) PATH fallback, and strict process-group (killpg) anti-orphan cleanup.
  • V4A Fuzzy Patch Editing (apply_patch):
    • Powered by DSH's built-in 4-pass fuzzy line matcher (@deepseek-ai/dsh-fs-patch), atomic multi-file preflight verification, and automatic interception of shell apply_patch <<'EOF' heredocs.
  • Cache-Preserving Incremental WorldState & Symmetric Truncation:
    • Verbatim Codex system prompts + hash-diffed <permissions instructions>, <collaboration_mode>, <multi_agent_role>, <multi_agent_mode>, and <environment_context> (>95% Prompt Cache hit rate).
    • 1 MiB HeadTailBuffer (512 KiB head + 512 KiB tail) + 10,000-token 50%/50% middle truncation, paired with Codex's 95% context compaction prompt.

FrontierHarness Benchmark Results (30 High-Discrimination Tasks)

Evaluated on 30 high-discrimination Linux engineering tasks sampled from frontier-harness-eval@v1.1.0 under identical container, timeout, and concurrency budgets (see docs/benchmark-report.md):

Configuration Model & Effort Tool Mode Pass Rate (30 Tasks) Median Task Time Cache Hit Rate
Baseline: DSH Creator (preset-cordis) gpt-6-luna (high) 35 mixed tools 40.00% (12/30) 235.7s 95.81%
Reference: Native codex-cli 0.164.0 gpt-6-luna (high) CodeModeOnly 50.00% (15/30) 239.4s 96.10%
dsh-codex-mode (Single-Agent) gpt-6-luna (high) CodeModeOnly 56.67% (17/30) 224.4s 97.23%
Reference: Native codex-cli 0.164.0 gpt-6.1-sol (ultra) CodeModeOnly 73.33% (22/30) 135.6s 95.88%
dsh-codex-mode (Ultra Multi-Agent V2) gpt-6.1-sol (ultra) CodeModeOnly 83.33% (25/30) 162.5s (co-passed) 95.42%

Installation & Usage

1. Install into DSH Web / Desktop Profile

Clone this repository and install it into your web profile via dsh plugin:

git clone https://github.com/TideDra/dsh-codex-mode.git
dsh plugin --profile web add /path/to/dsh-codex-mode

(Or ask the DSH Creator agent to install /path/to/dsh-codex-mode via plugin_manager.)

Once installed:

  1. Start a New Session in DSH Web UI and select the Codex preset.
  2. Notice the ⚡ Ultra switch at the bottom-left of the composer bar (enabled by default). Click it—or run /ultra off / /ultra on—anytime to toggle proactive multi-agent delegation.

2. Run One-Shot CLI / Headless Tasks

You can mount the exact same Codex harness in dsh headless without modifying any profile:

# Single-agent mode
dsh --profile headless --patch ./headless.patch.yml "Fix failing tests and verify"

# Enable proactive Ultra Multi-Agent V2 in headless mode
DSH_REASONING_EFFORT=ultra dsh --profile headless --patch ./headless.patch.yml "Audit and refactor concurrency bugs"

Repository Structure

.
├── package.json            # DSH bundle & Web client module manifest
├── cordis.patch.yml        # Web/Desktop patch declaring `preset-codex` + scoped UI entry
├── headless.patch.yml      # Isomorphic CLI overlay for `dsh --profile headless --patch`
├── client.js               # Browser slot (`conversation.input.left`) `Ultra` toggle switch
├── icon.svg                # Bundle & preset SVG artwork
├── locale/                 # English & Simplified Chinese bundle metadata (`en.json`, `zh.json`)
├── src/
│   ├── index.js            # Shared Cordis preset composition plugin
│   ├── ui-entry.js         # No-op Host roster anchor for the Web client bundle
│   ├── ultra-control.js    # Durable `codexUltra` session projection & scoped `/ultra` command
│   ├── prompts.js          # Verbatim Codex `0.164.0` instruction & tool templates
│   ├── env-context.js      # Incremental hash-diffed Codex `WorldState` injector
│   ├── code-mode.js        # GPT-6 `CodeModeOnly` (`exec` async VM sandbox + `wait`)
│   ├── collab-tools.js     # Multi-Agent V2 (`spawn_agent`, `wait_agent`, step-boundary drain)
│   ├── unified-exec.js     # `exec_command` + `write_stdin` (pipes, `node-pty`, `killpg` cleanup)
│   ├── patch-tool.js       # V4A `apply_patch` tool over `@deepseek-ai/dsh-fs-patch`
│   ├── truncation.js       # 1 MiB `HeadTailBuffer` + 10k-token 50%/50% middle truncation
│   ├── compaction-hook.js  # Verbatim Codex 95% context compaction prompt hook
│   ├── plan-tool.js        # Optional `update_plan` checklist tool
│   ├── view-image.js       # `view_image` multimodal image loader
│   └── dsh-deps.js         # Runtime package resolver across installed & `--patch` modes
├── test/                   # Unit, Web preset isolation, QA simulation & wire-diff test suites
├── eval/                   # Harbor benchmark runner, adapter & summary scorecards
└── docs/                   # Deep-dive architecture comparison & benchmark reports

Verification

With dsh available on your PATH (or DSH_RUNTIME_ROOT pointing to a DSH installation):

npm test

License

MIT

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类模型与 MCP
规则置信度中

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。