跪拜 Guibai
← All articles
DeepSeek · Agent · TypeScript

DeepSeek Harness Runs on a Plugin Architecture Where Even the Core Is Swappable

By minorcell ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Agent frameworks are proliferating, but most bake assumptions about models, tools, and control flow into a fixed core. Harness makes replaceability the default, which means teams can swap out the model provider, the agent loop, or the tool registry without rewriting integrations—a practical hedge while the agent stack remains unsettled.

Summary

DeepSeek Harness is an open-source agent runtime framework whose architecture treats every capability as a plugin. Built on the Cordis plugin system, it has no fixed kernel: model calling, session management, tool execution, and agent loops are all swappable plugins that communicate through typed services on a shared context and a waterfall event system that lets listeners modify or short-circuit downstream behavior. A CLI tool called `dsh` assembles these plugins from a YAML manifest, and the official Web version is simply a pre-configured plugin list with a UI on top.

The framework's four core mechanisms are services mounted on a global context accessed by key rather than by import, dependency injection that derives startup order from a dependency graph, typed events with a `waterfall` mode that allows interception and modification, and automatic cleanup of all registrations via `ctx.effect()`. A twenty-line plugin can listen for task completion events, call the model for a summary, and push a notification to WeCom—without hard-coded coupling to any other component.

This is a developer preview with explicit compatibility-breaking-change warnings, and the plugin publishing ecosystem is nascent. But the architectural bet is clear: in an agent stack that is still taking shape, survival depends on making every piece replaceable.

Takeaways
Harness has no fixed kernel; model calling, sessions, tools, and agent loops are all plugins assembled from a YAML manifest.
Plugins find each other through typed services on a shared context (`ctx.llm`, `ctx.tools`) rather than by importing specific implementations.
Startup order is derived automatically from a dependency graph declared via `inject`, eliminating manual orchestration.
The `waterfall` event mode lets a listener modify, wrap, or short-circuit downstream processing by controlling a `next()` call.
All listener and resource registrations through `ctx.effect()` are automatically cleaned up on uninstall or hot update.
Official plugins and user plugins operate at the same level; any official plugin can be replaced by a user-written alternative.
The framework is in developer preview with explicit compatibility-breaking-change warnings and no stable plugin publishing channel yet.
Conclusions

Harness's architecture inverts the VS Code model: instead of a stable kernel with pluggable peripherals, it is a composition of plugins with no kernel at all, which means the system has no privileged code that cannot be replaced.

The `waterfall` event pattern is a sharper tool than the broadcast events common in extension systems like VS Code's—it allows plugins to intercept and transform behavior mid-pipeline rather than merely observing it.

DeepSeek's decision to release Harness alongside V4 Pro, with aggressive token pricing, suggests a strategy of coupling a low-cost model with a framework that makes it easy to build and swap agent components, lowering the barrier to experimentation.

The framework's design treats replaceability as a survival strategy for an unsettled agent stack, not as a feature—if the right agent loop or tool pattern hasn't been settled yet, the system must allow every piece to be swapped without breaking the rest.

Concepts & terms
Cordis
A plugin framework that powers DeepSeek Harness, designed around spatiotemporal composability. It provides a shared context for services, dependency injection for startup order, typed events with interception modes, and automatic cleanup of registrations.
Waterfall event
A Cordis event dispatch mode where listeners receive a `next()` function. Each listener can modify data before passing it downstream, wrap the downstream result, or short-circuit the chain by returning without calling `next()`.
Harness (agent engineering concept)
An environmental system that lets an agent be stably steered—encompassing task expression, context organization, tool governance, state management, and feedback loops. DeepSeek Harness is a code-level implementation of this concept.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗