跪拜 Guibai
← All articles
DeepSeek

DeepSeek Harness: An Agent Runtime Where Even the Main Loop Is a Plugin

By 于宏儒 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

dsh is the first Agent runtime to open-source every layer down to the main loop, letting teams swap out any component without forking a codebase. For developers building internal Agent platforms or doing model evaluation research, it offers a level of control that closed products like Claude Code cannot match, though its developer-preview status and configuration complexity make it unsuitable as a drop-in replacement today.

Summary

DeepSeek Harness (dsh) is an open-source Agent runtime framework released alongside DeepSeek-V4-Pro. Its core philosophy, "Everything is a Plugin," means the model adapter, tool registry, session storage, sandbox, and the Agent main loop are all replaceable components loaded through the underlying Cordis framework. The official formula is Agent = Model + Harness, positioning dsh not as another coding assistant product but as a runtime base for assembling custom Agents.

The framework ships with four factory presets: Standard for daily development, Code/PTC for programmatic tool calling that compresses multiple rounds into one execution, Minimal for benchmarking, and Creator for building custom Agent modes. It offers three entry points—a Web UI, a headless CLI, and a Python SDK—and is model-agnostic, supporting providers from DeepSeek and OpenAI to local Ollama endpoints.

Version RC.8 makes Claude Code and Codex installable as Profile Bundles, allowing dsh to act as a scheduling layer that delegates specialized work to these sub-agents. A community plugin ecosystem has already exploded around it, with tools for file referencing, context visualization, multi-agent team orchestration, and desktop clients, though the project remains a developer preview with explicit warnings about breaking changes.

Takeaways
DeepSeek Harness is an MIT-licensed Agent runtime where every component—model adapter, tools, sandbox, session storage, and the Agent loop—is a replaceable plugin loaded via the Cordis framework.
Writing a basic tool plugin takes about 20 lines of TypeScript: export an apply(ctx) function, register a tool with defineTool, and mount it via a cordis.yml patch file.
Four presets ship out of the box: Standard (full programming Agent), Code/PTC (programmatic tool calling that compresses multiple rounds into one), Minimal (bash + file editor for benchmarks), and Creator (full suite for building custom modes).
RC.8 makes Claude Code and Codex installable as Profile Bundles, letting dsh schedule them as sub-agents for specialized tasks while handling orchestration with its own model.
Daily project development does not require writing plugins; the Standard preset includes file tools, Shell, search, planning, sub-agents, and workflows out of the box.
Third-party plugins run in the host process with full filesystem and network access, so source code review before installation is mandatory.
The official README warns in capital letters about compatibility-breaking changes, and the RC.8 SQLite schema upgrade made old session data unreadable with no migration tool provided.
DeepSeek V4-Pro switched to peak/off-peak pricing on August 16, 2026, with independent analysis showing output prices are roughly 2.28x the old flat rate even at off-peak times.
Conclusions

Making the Agent loop itself a plugin is the architectural decision that separates dsh from every other coding Agent. Claude Code and Codex lock their main loop; dsh treats it as just another capability seam, which means multi-agent architectures, custom scheduling, and self-modifying Agents can be built without forking.

The Cordis framework's "reversible side effects" model—where every registration automatically records its cleanup—solves the hot-reload problem that plagues plugin systems. Unloading a plugin truly removes its tools and listeners, leaving no residue.

RC.8's Claude Code and Codex integration is not about replacing those tools but about making dsh a meta-orchestrator. The architecture acknowledges that different coding Agents have different strengths and lets a team route work accordingly, which is a more pragmatic vision than trying to build one Agent to rule them all.

The community plugin ecosystem reached over 6,000 repositories within a week of launch, but the official stance that no package is more authoritative than another—combined with plugins running at host-process privilege—creates a security model that depends entirely on developer diligence.

dsh's configuration model uses whole-line patch replacement rather than deep merging, which means overriding one key in a plugin's config requires restating every other key. This design choice keeps the system predictable but makes configuration files brittle and error-prone for newcomers.

Concepts & terms
Cordis
A plugin meta-framework underlying DeepSeek Harness that handles loading, unloading, and dependency management. Its core innovation is "reversible side effects": every registration (tool, event listener, route) automatically records a cleanup action, so hot-swapping plugins leaves no residue.
Capability Seam
A design pattern in dsh where a replaceable capability is split into three decoupled roles: a Service Definition (what it's called), a Provider (the implementation), and a Consumer (the model-side tool). Swapping the Provider does not affect the tool schema the model sees.
Profile Bundle
A packaging format introduced in RC.8 that bundles a sub-agent provider (like Claude Code or Codex) as an installable unit. Bundles include a dsh.bundle field in package.json and a cordis.patch.yml that tells the Harness where to insert the plugin in the plugin tree.
PTC Mode (Programmatic Tool Calling)
A preset mode where instead of exposing tools one-by-one to the model, dsh generates a TypeScript SDK and lets the model write a program to call tools in batch. This compresses what would be multiple round-trips into a single execution, saving tokens and latency.
Trajectory (Append-Only Event Stream)
dsh's session logging model where everything the model sees—system prompts, reasoning, tool calls, context injections—is written to an append-only log. The principle is "model-visible means logged," enabling recovery, forking, replay, and auditing from a single event stream.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗