DeepSeek Harness Source Code Analysis: Prompt as a Runtime
dotey · x · 2026-08-14
The author deeply analyzed the DeepSeek Harness (DSH) source code, revealing that its core philosophy shifts away from static System Prompts towards a dynamic Prompt Runtime.
Core Architectural Designs:
- Modular Capabilities: Capabilities are split into Implementation + Interface + Model-facing Instructions. Each tool (like shell, filesystem) carries its own prompt instructing the model on its usage.
- Scoped Prompts: Divided into Global Prompt → Agent Scope → Agent-specific Override, acting like dependency injection for prompts.
- State/Instruction Separation: Explicitly separates stable Instructions, dynamic Runtime Context (e.g., cwd, git status), and Tools.
Comparison with Pi:
- Pi: Focuses on a minimal core where users assemble capabilities.
- DSH: Aims to pluginize almost everything, providing official, complete combinations.
Hardcore Session Mechanism:
- Built on the Cordis plugin loader, emphasizing reversible side effects (auto-cleanup on unmount) and spatial composability.
- Model adapters, tool registries, the agent loop, and even the UI are all plugins. There is no sacred, unmovable core.
- Sessions are append-only event streams. The model's final visible context must be entirely reconstructable from this log.
More from coding & agent
- Connecting Metrics, Traces, and Logs for AI Coding Agents in Production — Al_Grigor · 2026-08-14
- AI Beats StS2 A0 Difficulty But Fails to Match Top 5% Human Players — Jsevillamol · 2026-08-14
- Discussion: Catching AI Coding Agents' Confidently Wrong Codebase Assumptions — adarshvp2503 · 2026-08-14
- Demos are Magic, but 90% of AI Agent Code Handles Silent Model Failures — Ok-Salary-6309 · 2026-08-14
- Nitro: Open-source CLI agent turns natural language into shell commands with risk levels and permission prompts — chocolateUI · 2026-08-14
- xAI Highlights Top Internal Grok Bot Use Cases: Booking, Sales, and Automation — dean_rie · 2026-08-14