xushengqiong-ship/dsh-codex ↗★ 0

dsh-codex

Delegate heavy work from DeepSeek Harness to your local Codex CLI and bring back only the final answer.

パッケージ
dsh-codex
互換性
未検証
Harness ピア範囲
*
バージョン
0.2.0
ライセンス
MIT
最終更新
2026/11/14

同名パッケージの別リポジトリ

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:xushengqiong-ship/dsh-codex

ドキュメント

README 全文を読む ↗

dsh-codex

test

English | 简体中文

Delegate heavy work to your local Codex CLI (any model your Codex offers — defaults to gpt-6.1-sol with max reasoning effort) and bring back only the final answer into the main context.

Why

Main-model tokens should be spent on judgement; Codex quota on compute. This plugin therefore returns only the text that -o/--output-last-message writes, and never pipes process logs into the context — otherwise delegating would cost more than doing the work directly.

The trade-off: the main conversation sees no intermediate steps. That is why it only fits self-contained tasks.

Tools

ToolPurpose
codex_delegateRun one delegation: task + cwd + sandbox + timeout, returns the final answer
codex_modelsList the models the local Codex offers and the effort levels each supports; no model call, free
codex_statusShow the resolved executable, its version and every candidate; no model call, free

Choosing model and reasoning effort

Model and effort are not hardcoded. They come from your Codex via codex debug models, so a new model works as soon as your local Codex knows about it — no plugin upgrade needed.

Step 1 — see what you can pick

Ask the assistant to run codex_models (free), or run it yourself:

node smoke/list-models.mjs

It lists every model, the effort levels each model actually supports, the current default, and where that default came from.

Effort levels are not uniform: some models offer ultra, others stop at max. Do not copy someone else's config blindly.

Step 2 — pick one of three ways

You wantDo thisWhen it takes effect
Just this onceTell the assistant «use gpt-6-astra at high for this one»Immediately
Change the defaultEdit ~/.dsh/codex-delegate.jsonSaving the file is enough — no restart
Machine-wideSet env vars DSH_CODEX_MODEL / DSH_CODEX_EFFORTRequires a DSH restart

Minimal config file (only write the keys you want to change):

{
  "model": "gpt-6-astra",
  "effort": "high"
}

A malformed file will not break anything — the plugin ignores it and falls back to the built-in default. Sandbox and timeout can live there too:

{
  "model": "gpt-6-astra",
  "effort": "high",
  "sandbox": "workspace-write",
  "timeoutSec": 600
}

Setting env vars on Windows (a DSH restart is required, because the process only reads them at startup):

[Environment]::SetEnvironmentVariable('DSH_CODEX_MODEL','gpt-6-astra','User')
[Environment]::SetEnvironmentVariable('DSH_CODEX_EFFORT','high','User')

Precedence

call arguments  >  env vars  >  config file  >  built-in default (gpt-6.1-sol + max)

So even with astra in the config file, explicitly asking for luna in one call wins.

A combination the model does not support is rejected up front, with the list of effort levels it does support — instead of failing deep inside Codex with an opaque error.

When delegation pays off

  • The task can be stated in one paragraph and needs no back-and-forth
  • It requires reading many files / running commands / independent code changes, and you only need a conclusion or a diff
  • Failure is acceptable and a retry is cheap

When it does not

  • You need to judge step by step, or inspect intermediate output
  • The deliverable is a long document (bringing it back costs more than redoing it)
  • Small jobs — the cold-start overhead alone exceeds the savings

Supported Codex installations

Codex is not a single program; it ships in several local forms. Any one of them is enough — the plugin finds it automatically:

FormTypical locationStatus
CLI · npm / brew / install.shcodex on PATH; /opt/homebrew/bin, /usr/local/bin, ~/.volta/bin, ~/.bun/binSupported
Desktop app (Windows)%LOCALAPPDATA%\OpenAI\Codex\bin\\codex.exe, %LOCALAPPDATA%\Programs\OpenAI\Codex\bin\Supported, tested
Desktop app (macOS)CLI bundled inside /Applications/Codex.app (recursive search, depth ≤ 5)Supported, not tested
IDE extension · VS Code / Cursor / Windsurf / VSCodium`~/.vscode/extensions/openai.chatgpt-*/bin/
/codex` and similarTested: discovery and a real call both pass
Explicit overrideVS Code setting chatgpt.cliExecutable; env var DSH_CODEX_EXESupported, highest priority
Codex Web / CloudCloud only, no local binaryUnsupported — nothing to execute

Resolution order: complete > explicitly configured > newest. On Windows, "complete" means codex-command-runner.exe sits next to codex.exe; macOS and Linux have no such helper, so they always count as complete.

Not sure what it found? Run codex_status; it lists every candidate and the one in use:

Codex available
  path:    C:\Users\...\bin\c38161ad8494f88c\codex.exe
  version: codex-cli 0.169.0-alpha.11.1
3 candidates, in priority order:
  · ...\bin\c38161ad8494f88c\codex.exe   config file > built-in default
node smoke/test-config.mjs

# 5) Smoke test: stub out dsh-tools, verify registration, structure and argument validation; no model call
cd smoke
node --no-warnings --experimental-loader ./loader.mjs ./test.mjs

# 6) A real run (spends quota; ~2 min cold start)
cd ..
node test-run.mjs "Reply with exactly: OK"                        # read-only
node test-run.mjs "Create a.txt in the current directory" --write  # allow writes

Pass a relative path to --experimental-loader. Node rejects absolute Windows paths with ERR_UNSUPPORTED_ESM_URL_SCHEME.

Continuous integration

.github/workflows/test.yml runs the five offline tests above on ubuntu-latest / macos-latest / windows-latest with Node 22 and 24.

CI proves the discovery logic, module loading and argument validation work on all three platforms. It cannot prove that codex exec actually reaches the model — the runners have no Codex login, and burning quota in CI would be wrong. That last step has to be verified once on a machine with a real account.