DeepSeek's Open-Source Super-Agent Prototype: A Source-Level Breakdown
DeepSeek's Open-Source Super-Agent Prototype: A Source-Level Breakdown
Positioning note: the subject of this article is a research prototype, not a shippable product. The project describes itself as "Research prototype for reference only, not an official DeepSeek product" (README.md:3).
On 2026-10-31, the DeepSeek Harness (DSH) team, alongside the long-form essay on super-agent design (original, in Chinese), released the repository dsh-superagent-prototype: MIT-licensed, TypeScript, the entire repo in a single commit (6337fc8, created 09:32 UTC, last pushed 12:05 UTC the same day), 1,515 stars and 113 forks on day one. The essay explains the ideas; this repository shows what landed — parts of the essay's design are explicitly marked "not implemented in this prototype" (README.md:5), and what actually became code is knowable only by reading the source. Below are the engineering conclusions after a file-by-file read.
1. Why It Is Worth Reading: Not a Demo, a Runnable Plugin
Most "companion open-source" is a toy carved from one essay section. This repository is different: a set of plugins packaged as a DSH bundle. The host inserts three plugins — the main plugin, github-watch, and feishu-watch — into the DSH profile via cordis.patch.yml (package.json:30), and exports github-watch and feishu-watch as two Source plugin entries (package.json:17-18). Entries follow the Cordis plugin protocol (DSH's everything-is-a-plugin foundation, cordiverse/cordis): src/index.ts:5-7 declares the plugin name and inject array — 11 host-service injections in total; "private": true (package.json:6) signals no intent to be a standalone npm product — it exists for the DSH host.
It ships a complete domain model, a transactional state machine, persistence, tests, and an admin panel. Of the essay's Router/Worker split, event-driven design, and Inline/Spill — which landed and which stayed ideas — the code answers every question.
2. What Problem It Solves: A Proactive Coding Agent for One Repository
The official positioning is one sentence: "a proactive coding agent for one GitHub repository" (README.md:7). The flow: listen to GitHub (optionally Feishu) → authorized requests become Tickets through the Policy gate and model assessment → each Ticket executes in its own DSH session and working directory → delivery returns to the original conversation (a PR, for example) → the web panel shows where a human is needed.
The pain point is real: coding agents can already complete single tasks independently; the bottleneck has moved to human attention — who watches issues, comments, and red CI, and who moves tasks into the agent. This prototype closes the listen–assess–execute–reply loop so that humans appear at exactly two moments: authorization and acceptance. The design philosophy lives in docs/000-philosophy.md: "Take as little human attention as possible, and give as much value as possible." The code serves it: the main session never waits — everything that arrives is a message; guard regexes intercept sleep commands and reject blocking calls over 30 seconds (src/app/sessions.ts:64-66, 70-82).
3. Architecture: A Three-Plugin Combination Living on DSH
First, be clear: it is not a standalone framework. Direct runtime dependencies number just two — proper-lockfile 4.1.2 and zod 4.4.3 — plus 23 @deepseek-ai/* peer dependencies, with the host pinned to dsh ^0.2.1-alpha.2 (package.json:53-56). The layering is the cleanest part of the repo: src/core/ (16 files) is a pure domain model in which the Engine is the sole writer of Trigger/Thread/Decision/Ticket/Assignment — all methods synchronous, one transaction per command (src/core/engine.ts:47), zero I/O, importing nothing outside core; src/app/ (44 files) is the composition root and glue; src/sources/ (18 files) hold the Source abstraction with its GitHub and Feishu implementations; src/client/ (26 files) is the React panel injected into the DSH sidebar. The core also exposes role-scoped views: engine.ts:261-269 uses five EngineFor* Pick types to trim each interface to "only the part you need to see."
Role constraints live in the bundle patch: the worker preset is a trimmed DSH standard with a 21-item tool whitelist (src/app/sessions.ts:60-62); the router preset tightens in the opposite direction — tool-fs configured write: false, edit: false, read-only, subagents forbidden (cordis.patch.yml:125). The reasoning is direct: the moment the evaluator starts writing code, routing becomes execution. Communication is equally narrowed: replies carry a hard 100-word cap and purpose is enforced by the tool (prompts/replies.md); everything under prompts/ is "one sentence per line," assembled by promptFile (docs/004-prompts.md), and every save becomes an immutable revision that sessions bind to (src/app/sessions.ts:148-157) — prompts are auditable configuration, not scattered strings.
4. Code Highlights: State, Isolation, Cadence
State storage and atomic persistence. All state lives in a single SQLite database (<stateDir>/orchestrator.sqlite, 9 tables: trigger / disposition / trigger_thread / thread / ticket / decision / effect / outbox / kv — docs/007-architecture.md, "Persistence" section). At startup the Runtime locks stateDir with proper-lockfile before opening the database (src/app/runtime.ts:59), ruling out dual-process writes. All side effects go through a persistent effect queue: enqueued inside the transaction, executed only after commit (src/app/effects.ts:46), with six kinds (assessment / launch / delivery / relay / notice / reply) and exponential backoff — "it did it" and "it went out" are split into two separately recoverable stages, the most commonly ignored lesson in agent systems. The schema carries 11 data migrations and refuses older versions (src/app/migration.ts).
Task isolation. Each Ticket gets a worker-<ticketId> session and its own worktree directory (src/executor/dsh.ts:24); concurrency is capped by WorkerSlots at executor.maxWorkers, and a human follow-up can claim an extra slot with priority over new tasks (src/executor/dsh.ts:171); a worker's background shell tasks may keep running after its turn ends, capped at 30 minutes (src/executor/dsh.ts:37), killed on timeout and reported in the next turn.
Cadence and panel. The backend runs one pass every 2 seconds, advancing due effects and scheduled assessments (src/app/passes.ts:28); GitHub polling defaults to 60 seconds, adjustable between 60–3600 seconds (the pollSeconds schema in src/sources/github.ts). The panel is a 26-file React app, bilingual (locale/zh.json and en.json), with a test for every page (tests/panel-*.spec.tsx, 10 files total).
Context injection: the essay's Inline/Spill, landed as "inline card + read pointer." Assignments cap inline content at 1,500 characters, triggers at 600 (src/executor/dsh.ts:113: ASSIGNMENT_CHARS = 1500, TRIGGER_CHARS = 600); beyond the cap, content is truncated with a total length and a resource pointer such as trigger/<id> for on-demand reading (docs/007-architecture.md:594). The essay's more aggressive layered memory spill was never implemented — a repo-wide grep for "spill" returns zero hits, a textbook sample of the essay-versus-code gap.
5. Engineering Maturity: High by Prototype Standards
Nine self-consistently numbered docs, 59 test files (vitest config included) and 6 fixtures, a bilingual panel, SQLite migrations. Most notable are three "meta-tests": tests/docs.spec.ts forces doc cross-references to point only at earlier docs and to all resolve; tests/class-docs.spec.ts requires every class in src to carry JSDoc; tests/model-surface.spec.ts keeps the model-readable surface (tools / prompts / skills) from drifting and within size budgets. Turning "docs stay in sync with code" into a mechanical gate is a move worth copying by every team.
The immaturities deserve equal billing: a single commit for the entire repo, no CHANGELOG, no releases; no CI (no .github/ — checks rely on manual pnpm check); data grows with no cleanup mechanism — docs/007-architecture.md:484 states outright that trigger, disposition, decision, and similar records "grow without bound"; and the docs end with two open questions (Trigger field trustworthiness, deployment isolation).
6. What to Compare It With: Three Species, Don't Force the Match
Dify grows on the platform side and sells app distribution; orchestration frameworks like LangGraph sell process expressiveness. This prototype is a third species: its scope is deliberately narrowed to a single GitHub repository (the Source configuration hard-codes a single owner/name in src/sources/github.ts), and in exchange its domain model can go deep — Mandate authorization, subscription fan-out, transactional audit. Comparing it with Dify on ecosystem, or with orchestration frameworks on generality, misses the point; the question it answers is "can a single repository's daily chores take less of a human's attention?"
7. Five Things to Borrow, Three Not to Copy
Borrow (in priority order):
- The observe gradation: proactive candidates first "record only what they would do" without executing (the admission table in docs/002; prompts/admission.md: "observe mode records the judgement only"); after a human reviews for a while, switch to auto. Every expansion of agent autonomy deserves this setting first.
- Inline card + read pointer: all cross-session input follows "inline ≤ N characters + a resource pointer read on demand" (src/executor/dsh.ts:113), eliminating whole-file pastes into context.
- Mandate: authorization records the "on what grounds": every accept must attach intent_evidence quoted verbatim (prompts/admission.md); when policy changes, running tickets are notified rather than killed (src/policy.ts:167 and engine.policyChanged).
- A persistent effect queue: every outward action is enqueued, merged, backed off, with one health item per kind (src/app/effects.ts:46).
- The meta-test moat: doc sync, JSDoc coverage, and model-surface stability, all mechanized (tests/docs.spec.ts, class-docs.spec.ts, model-surface.spec.ts).
Don't copy:
- DSH alpha ecosystem binding: 23 peers pinned to an alpha host, and the TODO at src/index.ts:17 is a compatibility shim for host behavior — outside that ecosystem this codebase is worth essentially zero.
- Single-process SQLite with unbounded data growth: the directory-lock plus single-writer assumptions fit one machine and one repository only (docs/007-architecture.md:484).
- "Tool trimming" as a security boundary: worker permissions are danger-full-access (src/app/sessions.ts:152); isolation relies on the 21-item WORK_TOOLS whitelist and guards (src/app/sessions.ts:60-62), not a sandbox. Porting its task model requires bringing your own sandbox layer.
8. How to Try It: Setup, Risks, What to Watch
Prerequisites (SETUP.md, "Probe" section): Node.js 22.19+ or 24+, pnpm, git 2.32+, tmux, Python 3.8+, GitHub CLI 2.48+, a DSH within the engines range (package.json:53-56), a model provider, and a dedicated GitHub agent account — SETUP.md states plainly "never the operator's own"; everything the agent writes is committed under that name. The service is managed by a 250-line Python script (scripts/dsh-superagent), the panel runs on port 3082, and state lives in ~/.dsh/state/superagent. Dependency availability is verified: @deepseek-ai/dsh-agent 0.2.1-alpha.2 is present on the public npm registry.
Risk notes: alpha dependencies, self-declared research code, no CI, data that only grows; the Feishu source is off by default (cordis.patch.yml:10-11) — out of the box, GitHub only. What to watch: run in observe mode first, check the false-positive rate in the admission decision logs, then consider auto; watch worker concurrency limits and effect-queue health items.
9. Closing: The Distance Between Prototype and Product
The distance is not in features — the trigger-to-reply lifecycle is already a closed loop — but in ecosystem and governance: the host is still alpha, no CI, no versioned releases, data governance not done, two open questions unresolved. Its real value is a complete reference implementation of "a proactive agent for one repository": a five-entity transactional core, subscription fan-out, a persistent effect queue, meta-test gates — all re-implementable outside DSH. For engineers, reading it beats installing it; wait until its host ecosystem matures before running it.
More in Learn
- The 74k-star Open-Source Life Guide: What Its Evidence Grading Is Worth Copying
- The Eight Acceptance Gates for AI-Generated Reports
- PStack Deep Dive (Part 1): How a Cursor Plugin Turns Engineering Discipline into Executable Files
- PStack Deep Dive (Part 2): Two Agents, Five Special Designs, and How It Actually Lands