前言¶
DeepSeek Harness 默認由單一模型處理整個任務。這個插件引入 Codex 和 Claude Code 作爲子代理,支持讀寫分離與並行執行,解決了單一模型在特定工具鏈(如代碼審查、測試運行)上能力受限的問題。
插件定位¶
- 名稱:
dsh-preset-codex-claude - 作者:Magica-Chen
- 分類:工作流
- 簡介:DeepSeek Harness agent preset:Codex and Claude Code as delegation subagents at read-only and full-access tiers.
核心功能¶
該插件提供以下能力:
- 子代理支持:將 Codex 和 Claude Code 作爲子代理引入。
- 權限分級:每個廠商提供只讀和完全訪問兩個層級。
- 並行運行:支持在同一個會話中同時運行兩個子代理。
- 官方實現:使用官方 @deepseek-ai/dsh-subagent-codex 和 @deepseek-ai/dsh-subagent-claude-code 提供商,無二次封裝。
- 輕量級:作爲聲明層,註冊了四個提供商和四個工具。
安裝與啓用¶
安裝分爲兩步,順序不能顛倒:
- 安裝提供商包到 DSH 安裝目錄(注意:不是安裝到 profile,而是安裝到 dsh 的安裝根目錄)。
升級 DSH 後需要重新運行此步驟,因爲升級會清除依賴。
DSH_INSTALL="$(dirname "$(dirname "$(readlink -f "$(command -v dsh)")")")"
npm install --no-save --prefix "$DSH_INSTALL" \
@deepseek-ai/dsh-subagent-codex@0.2.0-rc.2 \
@deepseek-ai/dsh-subagent-claude-code@0.2.0-rc.2
- 安裝預設到 Profile。
dsh plugin --profile web add github:Magica-Chen/dsh-preset-codex-claude
安裝完成後,重啓 dsh 並創建新會話以使插件生效。
典型用法¶
在 DSH 會話中,可以通過以下四個工具進行代理調用:
subagent_codex:Codex 完全訪問模式subagent_codex_readonly:Codex 只讀模式(繼承用戶配置)subagent_claude_code:Claude Code 完全訪問模式subagent_claude_readonly:Claude Code 硬性只讀模式
示例用法:
subagent_codex task="Run the test suite and fix the two failures in parser.js"
subagent_claude_code task="Review the diff on this branch for security issues"
所有子代理均以獨立進程啓動,不繼承當前會話上下文,因此提示詞必須自包含。
權限與限制¶
插件對權限有明確的劃分與限制:
- Claude 只讀模式 (
subagent_claude_readonly):這是一個硬性阻斷。該模式無法運行測試或構建(包括 Bash 命令),除非使用bypassPermissions。 - Claude 完全訪問模式 (
subagent_claude_code):使用bypassPermissions,可讀寫文件並運行命令。 - Codex 只讀模式 (
subagent_codex_readonly):這是建議性的,不強制阻斷,直接繼承用戶的~/.codex配置。 - Codex 完全訪問模式 (
subagent_codex):使用dangerously-bypass-approvals-and-sandbox。
由於子代理聲明瞭 NO_START_CAPABILITIES,因此無法使用 toolFilter 和 persona。
注意事項¶
- 版本匹配:提供商包與 DSH 主程序版本必須匹配。版本不匹配會導致靜默的代理調用失敗。
- 進程級緩存:如果預設加載失敗,該錯誤會在整個進程生命週期內被緩存,僅重啓 dsh 可清除。
- 單次調用:代理調用是“一次性”的,不暴露可繼續對話的模式。
- 會話隔離:已存在的會話無法自動應用新安裝的預設,必須創建新會話。
- Profile 要求:需要使用
dsh webprofile。
結語¶
該插件爲 DSH 生態提供了 Codex 和 Claude Code 的官方集成方案,適合需要針對不同代碼工具進行精細權限控制和並行處理的開發者。