dsh_agentlink
Enables Codex and Claude Code to delegate implementation, research, debugging, and long-log work to DeepSeek Harness, then observe, continue, or cancel those sessions without leaving the primary workflow.
README
Codex-DSH-Orchestrator
English | 简体中文
Codex-DSH-Orchestrator is a Codex-first orchestration layer and caller-side MCP bridge for bounded collaboration with DeepSeek Harness (DSH). It lets Codex delegate implementation, research, debugging, and long-log work to DSH, then observe, continue, or cancel those sessions without leaving the normal workflow. Claude Code remains supported through the shared caller integration layer; other callers are deliberately deferred until their host behavior can be verified.
The shared bridge runtime in this repository is an independently maintained derivative of the upstream dsh-Agentlink project. The project retains the upstream MIT license and copyright attribution and is not affiliated with or endorsed by DeepSeek, OpenAI, or the upstream maintainers.
Project boundary
Codex-DSH-Orchestrator is a caller-side orchestration and MCP bridge project. It connects supported callers to an independently running DSH Web Host; it does not start, own, or authenticate that Host, and it never auto-approves DSH requests. It is not a DSH Cordis bundle.
Project components
- skill/codex-dsh-orchestrator/ — the project-specific Codex orchestration skill and its agent metadata.
- skill/codex-dsh/ — the shared Codex caller compatibility skill.
- skill/claude-code-dsh/ — the retained Claude Code caller compatibility skill.
- src/ — the shared caller-neutral MCP bridge runtime and setup tools.
- test/ — local mock-host, safety, compatibility, and integration tests.
- docs/project-overview.md — the detailed ownership and architecture map.
The dsh-Agentlink name remains in runtime identifiers and upstream attribution for compatibility and legal clarity; it is not the public project title.
Caller support
| Caller | Status | Setup or availability |
|---|---|---|
| Codex | ✅ Supported | npm run setup |
| Claude Code | ✅ Supported | npm run setup:claude -- --project /absolute/path/to/project |
| ZCode | ⏸ Deferred | First candidate when verified caller-expansion work resumes |
| OpenCode | ⏳ Planned | Not available yet |
| Workbuddy | ⏳ Planned | Not available yet |
Only callers marked Supported have an installation path in this repository today. Planned entries are directions, not release commitments.
Installation
Prepare the environment first: you need Node.js 22+, a supported caller (Codex or Claude Code), and a working DSH CLI. The tested cross-platform baseline is x64 Node.js 22 and 24; other Node.js majors and ARM64 environments are not covered by the current matrix. Configure your preferred model in DSH once; the shared bridge inherits that live route unless a delegate explicitly requests a supported semantic profile.
Portability and installation boundaries
- On another machine, use a fresh clone. Do not copy a single worktree directory: its
.gitfile points to the source clone's worktree metadata. On the same machine, create worktrees from the source clone withgit worktree add. - Prefer
npm cifor a clean, reproducible checkout. Usenpm installonly when you intentionally want to update the lockfile. npm run setupwrites the absolute Node.js executable and built bridge entry point into the caller configuration. Keep the checkout in a stable tools directory; after moving it, changing the Node.js installation, or switching to another worktree, rebuild and run setup again, review the existing entry, and use--replaceonly with explicit approval.- Codex MCP setup and Codex skill installation are separate.
npm run setupregisters the MCP entry but does not installskill/codex-dsh-orchestrator/. Install and enable that skill through your normal Codex skill workflow, then verify that it is discoverable before relying on the$codex-dsh-orchestratorcommand. Claude Code setup manages its project skill separately as described below. - Keep
DSH_BRIDGE_HOMEon a reliable local filesystem. Do not copy an old bridge home to another machine; use a fresh home there. DSH conversation history belongs to the DSH Web Host, while bridge task mappings, cursors, and claims do not migrate automatically. - Windows
desktop-autois opt-in. It requires an already-running DSH Desktop Host and the supported Windows process/loopback discovery prerequisites; CI mocks these behaviors and does not prove real Desktop installation or login. The setup wizard never starts, stops, or logs in to DSH Desktop.
Install with your AI agent
Send the following repository URL and prompt to Codex or another coding agent:
Install Codex-DSH-Orchestrator from https://github.com/Fly2Kiana/Codex-DSH-Orchestrator.
Check Node.js 22+, the DSH CLI, and my DSH Web Host first. Clone it into a location I approve,
run npm ci and npm run check. For Codex, run npm run setup -- --yes, then install and verify
the shipped Codex skill separately through my normal Codex skill workflow. For Claude Code, run
npm run setup:claude -- --yes --project /absolute/path/to/my/project.
For Claude Code, let setup install the project MCP entry and shipped project skill; use --replace and --replace-skill only after reviewing existing files.
If dsh_agentlink or the legacy dsh_collab entry already exists, show me the conflict before using --replace.
Do not start or stop dsh web for me. Tell me when I need to reload the selected caller and approve project MCP trust.
Manual installation
-
Check the environment. DSH CLI
0.1.0-rc.6is the current tested target.node --version dsh --version -
Start the official DSH Web Host in its own terminal.
dsh web -
Clone the repository and install its dependencies.
git clone https://github.com/Fly2Kiana/Codex-DSH-Orchestrator.git cd Codex-DSH-Orchestrator npm ci -
Configure your caller.
For Codex:
npm run setup npm run doctorOn Windows with DSH Desktop and its changing loopback port, select automatic discovery explicitly:
npm run setup -- --desktop-autoThe Codex wizard backs up the Codex TOML configuration and installs the MCP entry with
approval_mode = "prompt"; it does not installskill/codex-dsh-orchestrator/. Install and enable that skill through your normal Codex skill workflow, then verify it is discoverable. Static setup keeps requiringdsh --version;--desktop-autocan instead validate the already-running Desktop Host even when the CLI is not onPATH, and reports the missing package version as a compatibility warning. It never starts or stops DSH Desktop. Switching an existing bridge entry to either mode still requires reviewing it and adding--replace. Restart Codex, then use/mcpor Codex Settings to confirm thatdsh_agentlinkis connected. For fully manual TOML setup, see Manual Codex MCP configuration.For Claude Code 2.1.199 or newer, point the setup command at the project that should share
.mcp.json:npm run setup:claude -- --project /absolute/path/to/your/project cd /absolute/path/to/your/project claude mcp get dsh_agentlinkThe Claude setup edits only that project's
.mcp.jsonand.claude/skills/claude-code-dsh/SKILL.md, and preserves unrelated servers. It reports each of these separately:- MCP registration
- project trust
- Claude skill status
- Claude approval support
- DSH permission/sandbox ownership
- DSH Host reachability
Open Claude Code in the project and approve the pending server through
/mcp; the bridge marksdsh_resolve_approvalas requiring human interaction.Add
--yesfor unattended defaults. To update an existing MCP entry, review it first and then add--replace; to update an existing Claude project skill, review it first and then add--replace-skill; to manage the skill yourself, add--no-skill. Both installers recognize the legacydsh_collabentry and migrate it todsh_agentlinkonly after explicit replacement approval. Neither installer starts DSH, changes DSH permission/sandbox settings, or restarts the caller.
The doctor reports the bridge's fail-closed lock locations under DSH_BRIDGE_HOME read-only and never cleans them, so it is safe to run even when a lock is present.
This source patch stops new projection/chunk floods from expanding the coordination ledger, but it does not compact an existing 5 MB+ ledger. Preserve the old bridge home for inspection; new delegations can use a separate DSH_BRIDGE_HOME. DSH session.history, not the bridge ledger, remains the conversation source of truth. See Known issues for the conservative recovery boundary.
This bridge (runtime name dsh_agentlink) is a caller-side plugin, not a DSH Cordis bundle. Do not install it with dsh plugin --profile ... add ....
Why Codex-DSH-Orchestrator?
Use DSH's Harness capabilities
DSH combines persistent sessions, tool execution, subagents, and human supervision for complex work. Codex-DSH-Orchestrator lets your primary caller—currently Codex or Claude Code—discuss and coordinate with that second harness while you stay in the same workflow.
More than another native subagent
A native subagent remains inside the caller's own agent tree. The shared bridge adds a separate, user-configured harness: its sessions stay visible in DSH Web, can use DSH's own workers and model route, and can be observed, continued, or canceled by the primary caller.
Save time and cost
- Save time. Route implementation, research, extraction, and long-log work to a fast model configured in DSH, such as a DeepSeek V4 route, while your primary agent keeps planning and validating.
- Save money. Moving execution-heavy workloads to a lower-cost DeepSeek route can reduce consumption on more expensive primary models.
Actual speed and cost depend on the selected model, provider, deployment, network, and task. Once installed, you can keep working in Codex or Claude Code as usual and simply ask it to delegate when DSH is the better execution path.
Use it
Once dsh web is running and your caller has loaded and trusted the MCP configuration, ask Codex or Claude Code in normal language, for example:
Use Codex-DSH-Orchestrator to delegate this implementation to DSH in the current repository. Keep it visible in DSH Web, report progress, and ask me before any approval.
The caller can then delegate the task, observe its event stream, continue the same session, answer questions with you, or cancel work. Open the configured DSH Web origin to inspect and interact with the same session. On Windows, an opt-in DSH_HOST_MODE=desktop-auto runtime can discover the verified loopback listener owned by DSH Desktop instead of relying on its changing ephemeral port; an explicit DSH_HOST_URL always wins.
Before a new delegation, the caller builds a compact handoff in the prompt from already-known progress and read-only workspace evidence: objective, completed work, Git HEAD/status and changed paths when available, focus code/Markdown paths, relevant tests, constraints, and unresolved issues. It tells DSH to read the focus paths first and avoid a repository-wide scan unless blocked. The handoff excludes secrets, raw large diffs, file bodies, caller chat, and internal reasoning. This is guidance for the caller, not new filesystem authorization; dsh-Agentlink does not receive prior caller conversation state automatically. For the same known BridgeTask, the caller uses dsh_followup; if no matching task id is known, it starts a fresh delegation rather than guessing an old id.
When the user explicitly identifies an existing DSH Desktop session, the caller can first use dsh_find_sessions to read bounded root-session metadata, then use dsh_attach_session with the exact returned session id and fresh metadata preconditions. Titles are discovery aids, never attachment identities. Attachment accepts only an idle root session, creates or reuses bridge-local mapping and workspace-claim state, and may reconcile history for supervision without returning or persisting conversation bodies. It does not create or rename a DSH session, send a prompt, or change model routing. A later dsh_followup carries the compact handoff when work should continue.
Reusing a session across Codex tasks is a conservative three-way choice: same-known-task, attached-existing-task, or new-session. Reuse only the same known BridgeTask for the same workstream; for a new task with explicit continuation evidence, discover exactly one canonical-cwd, mapped, idle root through metadata-only dsh_find_sessions and attach with fresh preconditions before continuing with dsh_followup. Never reuse by title or similarity and never read history for discovery; fail closed on ambiguous, running, stale, missing-cwd, or mapping-conflict candidates. Reuse can save handoff and repository-reading work but can increase input tokens, so it is a cost optimization only while continuity remains relevant. Reuse and avoided rescans are not proof of provider prompt-cache hits or token discounts; provider cache evidence is not exposed unless DSH publishes documented aggregate usage telemetry.
MCP tools
dsh_host_status— connect-only Host state and capabilitiesdsh_find_sessions— bounded metadata-only discovery of existing root sessions; no history or raw projectionsdsh_attach_session— safely attach one exact idle root session using fresh id/title/cwd/update preconditions; no prompt or model changedsh_delegate— create a root session and queue the initial prompt; optionally selectinherit|flash|pro|modlens-flash|modlens-proplus a catalog-supportedreasoningEffort; detached by default (waitSeconds=0);workspaceModeis a bridge-local claim, not a DSH sandbox selectordsh_followup— continue the same root session with explicitmode="queue"|"steer"(defaultqueue); optionally select the same semantic model profiles and validated reasoning effort before the promptdsh_continue— compatibility alias fordsh_followupdsh_status— availability, execution, lineage, queue, pending interactions, final message, cursors, and workspace claim semanticsdsh_tail— bounded event digests using a bridge task cursordsh_wait— wait up to 30 seconds for a durable event, state change, pending interaction, or terminal statusdsh_observe— compatibility alias arounddsh_wait; bridge cursors replace raw session seq cursorsdsh_cancel—scope="turn"|"queue"dsh_list— task mappings enriched with current derived statusdsh_answer_question— typed answer for a pending question rpcIddsh_resolve_approval— typedallow_once|rejectresponse for a pending approval rpcIddsh_release_workspace— explicitly release a persistent bridge workspace claim without closing the DSH session
Model routing is opt-in and backward-compatible for both delegation and follow-up. When modelProfile and reasoningEffort are omitted, the operation reads session.models.current, verifies routable, and does not call session.selectModel. The semantic mappings are flash/pro -> deepseek-official/deepseek-v4-{flash,pro} and modlens-flash/modlens-pro -> deepseek-modlens/deepseek-v4-{flash,pro}. The requested provider, model, and effort must exist in the live session.models catalog. Selection is performed and re-read before the initial or follow-up prompt; any mismatch fails closed without sending that prompt.
An explicit user choice always wins. Without one, the primary caller may keep inherit, use Flash for routine search/implementation/test repair, use Pro for architecture or difficult multi-step debugging, and use the corresponding ModLens profile when visual evidence is essential. dsh-Agentlink transports text prompts only: include absolute local image paths that the DSH Host and ModLens tools can access; it does not upload image bytes. selectionReason provides an optional audit explanation and is not sent to DSH.
On the locally verified DSH rc.6 collapsed Code Mode path, visual handoffs use the outer run_code transport and call registered modlens_read_image through the injected tools SDK inside that program. A caller should treat that outer event as expected, forbid shell/browser/OCR/image-library fallbacks, and wait for the nested result or an explicit nested/terminal error. A plugin's documented inner timeout is not the overall delegation deadline. This is version-scoped compatibility guidance; later Hosts should follow their verified live capability when it differs.
Important DSH rc.6 side effect: session.selectModel also saves the selection as DSH's global default for later sessions. Delegate and follow-up results report modelRouting.persistsAsDshDefault=true and a warning whenever explicit selection occurs. Omit routing fields if that persistence is not acceptable. If selection verification fails after the write was attempted, no prompt is sent, but the requested selection may already be the global default.
dsh_wait observes durable bridge state. Assistant delta/chunk frames and top-level session/projection snapshots are skipped, so they do not bump the task revision or wake waiters; complete final messages remain observable through status/tail after the turn ends.
Roadmap
These are planned directions, not implemented capabilities or release commitments.
- More caller entrypoints — evaluate ZCode first when caller expansion resumes, then consider OpenCode, Workbuddy, Claude Desktop MCP, and other callers through the shared Integration Pack architecture.
- Agent invocation and information transport — improve prompt organization, context packaging, output digests, and compression while keeping questions, approvals, errors, and final answers reliable.
- DSH plugin-aware sessions — preserve the current
agentPresetpath for preset-based plugins, add read-only preset/capability validation and resolved-preset reporting, and introduce a declarative session launch profile only when a plugin proves it needs typed post-create initialization. - More integrations — expand after the shared Runtime and caller compatibility contract stabilize.
More documentation
- Project overview — public identity, component ownership, and the Codex-first architecture
- Architecture and safety model — identity, state, recovery, approvals, cancellation, and workspace coordination
- Multi-caller extension architecture — shared Runtime and Integration Pack boundaries for Codex, Claude Code, and future callers
- Deferred roadmap — deliberately postponed work, activation triggers, and preserved safety boundaries
- Validation guide — compatibility and operator acceptance checks
- Known issues — current upgrade and concurrency caveats
- Contributing and security
License
Alpha note: DSH is still in developer preview and this community project is independent of DeepSeek and OpenAI. 0.1.0-alpha.1 contains a shared-ledger concurrency bug; it is fixed in 0.1.0-alpha.2. Read Known issues before upgrading or running concurrent bridge processes.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。