treg
superdesigndev
OpenRouter for agent tools. Join community here: https://discord.gg/6mQYYfFMAn
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:hotheat/dsh-claude-codex-mode
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 简体中文
Discuss / Execute Split is a DeepSeek Harness (DSH) bundle that splits the work in two: discussion stays read-only, and every repository code edit goes to Codex.
api mode pick a Claude model as the DSH default.git status, git diff, and the test results itself before reporting back.A write guard enforces this split. If the model tries to write a repository code file with a structured edit tool, the guard blocks it and tells the model how to hand the edit to Codex.
You choose the mode in this plugin's form on the DSH Plugins page. Switching takes effect without restarting DSH.
| Mode | Who discusses | Who edits | MCP servers mounted |
|---|---|---|---|
api (default) |
The DSH model itself. You configure an Anthropic provider (API key) on the Models page and pick Claude | Codex host tools | None |
claude-code-cli |
The DSH model forwards discussion to the Claude Code CLI in read-only discuss/review modes, using your Claude subscription login (no API key) |
Codex host tools, called by the DSH model | claude-code |
In claude-code-cli mode, Claude Code cannot see the DSH session. The routing prompt therefore tells the DSH model to:
mcp__claude-code__claude_code_run call;resumeSessionId;claude_code_run supports three modes:
| Mode | Behavior |
|---|---|
discuss (default) |
Read-only discussion of requirements, plans, architecture, docs and code; plans and designs state their assumptions, trade-offs and failure conditions. |
review |
Read-only code or change review, reporting findings with file paths and line numbers, ordered by severity. |
task |
Requires an explicit permissionMode; permissions and tool access follow the caller's configuration. |
discuss and review share --permission-mode plan --safe-mode --strict-mcp-config --tools Read,Glob,Grep, with different prompt preambles for discussion and findings.
Both modes ignore caller overrides for permissionMode, allowedTools, allowedCommands, disallowedTools, mcpConfigFile and strictMcpConfig.
Repository code edits still go to Codex through the routing rules below.
outputFormat defaults to "json", which returns output when the process finishes.
Set outputFormat: "stream" explicitly when progress is needed; this passes --output-format stream-json --verbose to Claude Code.
Stdout events flow through the runner to the background worker, which updates the job's event count, latest assistant tool name and last activity time, with activity reports throttled to once per second.
The final result, cost, duration, session and model usage come from the last result event.
Set stallAfterMs (minimum 1000) to terminate the process group after that many milliseconds without stdout or stderr data.
The outcome reports status: "failed", stalled: true and timedOut: false, preserving stderr.
This idle limit is optional and separate from timeoutMs, the total execution deadline.
The host registers codex_cli_setup, codex_cli_run and codex_cli_review directly, sharing schemas and the runner with the bundled standalone MCP fallback.
codex_cli_setup probes the executable and login asynchronously.
Runs stream JSONL events through the host into ctx.jobs, so the session header's Background jobs panel shows live output, progress, duration and a stop button.
Foreground calls are jobs too: they wait up to timeoutMs (four minutes by default), return the canonical Codex result on settlement and remove the collected row.
If that wait expires, the process continues and the call returns a jobId; the row stays available after completion.
Set background: true for an immediate handle; timeoutMs above 240000 also selects background execution and remains the process deadline.
Use DSH job_output to read/wait, job_list to list and job_kill to stop a job; continue Codex with resumeSessionId.
Caller abort kills and collects a foreground job before throwing; stopping from the panel terminates the whole Codex process group.
The task panel requires @deepseek-ai/dsh-jobs-local and @deepseek-ai/dsh-tool-jobs in the composition.
Without the registry, foreground calls run directly with a timeout and background calls fail with a mount hint.
If registration is refused because the session has no job controller or has reached its job cap, the host logs a warning and runs foreground calls directly; background calls report the admission error.
In the plugin's Discussion mode form, Codex output controls where runs appear:
jobs (default): use dsh-better-sidebar's built-in Background jobs drawer; the Codex tab is not registered.tab: register a dedicated Codex sidebar page; requires dsh-better-sidebar.Changing this option saves immediately, without preflight checks or a page reload.
With tab selected, open the right sidebar's + menu and pick Codex to list this session's Codex runs and stream the selected run's output live.
The tab also supports copying output and stopping a running job with a second confirmation click.
The tab option remains selectable when the sidebar plugin is absent, and the form shows an installation hint.
When the form opens, it checks the current mode and shows the result:
When the API card is selected, the form also shows the Anthropic provider settings DSH is using:
These are read-only here. To change them, open Settings → Models. A plugin form cannot open that page for you.
Test connection asks the provider for its model list (GET /v1/models) with the current key, so it uses no tokens.
Clicking Check and save runs a preflight check for the target mode first. If any blocking check fails, the save is refused, the current mode stays, and the form lists each failed check with a fix hint.
| Scope | Check | Level |
|---|---|---|
| All modes | Node.js ≥ 20 | Blocking |
| All modes | codex --version succeeds |
Blocking |
| All modes | codex login status reports logged in |
Blocking |
| All modes | Bundled standalone MCP fallback mcp/codex-cli/server.mjs exists |
Blocking |
api |
llm-pi-ai has an anthropic provider with at least one model |
Blocking |
api |
The credential its apiKeyEnv points to exists (checked for presence only) |
Blocking |
api |
The default model is not Claude | Warning |
claude-code-cli |
claude --version succeeds |
Blocking |
claude-code-cli |
claude auth status reports loggedIn: true |
Blocking |
claude-code-cli |
Bundled mcp/claude-code/server.mjs exists |
Blocking |
About these checks:
>=0.2.1-rc.2 <0.3.0, Node.js ≥ 20.PATH and logged in (codex login).api mode: an Anthropic provider for llm-pi-ai with a saved API key (see below).claude-code-cli mode: Claude Code on PATH and logged in (claude auth login).The executables are found through the PATH of the DSH process. To point at a specific binary, set CODEX_CLI_PATH or CLAUDE_CODE_CLI_PATH before starting DSH.
dsh plugin --profile web add github:hotheat/dsh-claude-codex-mode
Then enable it on the Plugins page. It is listed as Discuss / Execute Split, or 讨论执行分工 (claude-codex-mode) in Chinese. No build step is needed.
api modeAdd an Anthropic provider to your profile patch (for example ~/.dsh/profiles/web/cordis.patch.yml):
- id: llm-pi-ai
config:
providers:
anthropic:
apiKeyEnv: ANTHROPIC_API_KEY
# baseURL: <optional relay base URL>
models:
- id: claude-sonnet-5-5
- id: claude-opus-5-5
~/.dsh/.env. The patch should name only the environment variable, never the key itself.agent-default-model row is applied after bundles./model.The guard checks the path arguments of four structured file-writing tools: write, edit, str_replace_editor, and apply_patch.
str_replace_editor with command: "view" is read-only and always allowed.apply_patch is listed for forward compatibility. DSH 0.2.1-rc.2 has no such tool.bash / pwsh are not checked. The routing prompt tells the model not to use sed -i, heredocs, or redirection to get around the guard, but nothing enforces that.How each write is decided:
Relative paths with no known session directory are denied, and the model is asked to use an absolute path.
The guard allows these writes directly:
.md, .mdx, .markdown, .txt, .canvas, .base, or .rst (case-insensitive). The exceptions are requirements*.txt, constraints*.txt, and CMakeLists.txt, which count as config.~/.claude..claude/direct-edit at their root.DSH_DIRECT_EDIT=1 or CLAUDE_DIRECT_EDIT=1.If the Codex tools fail to come online, the guard stays active, and its deny message says that Codex is unavailable.
From a clone of this repository:
npm install
npm run doctor
npm run doctor -- --mode claude-code-cli --profile web
doctor runs the same preflight checks offline and exits non-zero if a blocking check fails.api mode it reads the selected profile's cordis.patch.yml without evaluating !!js expressions..env, and ~/.dsh/.env.Codex runs use the process-local DSH job registry.
Claude Code MCP job state is stored under <DSH home>/claude-codex-mode/claude-code/.
npm test
node --test mcp/*/tests/*.test.mjs
npm test covers:
The load test finds Cordis through DSH_CORDIS_PATH, and failing that through a global @deepseek-ai/dsh install (npm root -g). If neither is found, it is skipped with a message.
The bundled MCP servers in mcp/codex-cli and mcp/claude-code come from the author's own earlier plugins. See ATTRIBUTION.md for where each part comes from.
MIT © 2026 Jiaoguo
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: api、cli。