PapersSelected

DeepSeek Harness source code mirrors classic server-side IoC architecture

Why we picked it

The takeaway is that agent infrastructure is converging on battle-tested enterprise framework patterns rather than inventing new abstractions, so lessons from Node.js ecosystems transfer directly. Engineers building agent runtimes or plugin systems can study DSH's Fiber and Effect mechanisms as a working reference for dynamic module composition. Teams comparing agent frameworks with Tegg, NestJS or similar IoC containers will find the architectural mapping a practical evaluation checklist.

A developer who reviewed the source code of DeepSeek Harness (DSH) argues that it is essentially an IoC module system built for an Agent Runtime with dynamic plugin lifecycle support. The comparison was posted by Barret_China, an engineer who previously helped design Tegg, an enterprise Node.js framework.

Body

The analysis maps Tegg's concepts onto DSH: Tegg declares object scopes with SingletonProto() and ContextProto() and manages dependencies with Inject(), while DSH registers Services and uses inject to connect capability providers and consumers. Tegg offers a fine-grained lifecycle (postConstruct, preInject, postInject, init, preDestroy, destroy), whereas DSH manages plugin lifecycles through Fiber, moving through PENDING, LOADING, ACTIVE, UNLOADING and DISPOSED states, with Effect objects tracking resources and side effects registered by plugins. DSH additionally supports dependency-driven dynamic loading, unloading and reassembly, with Plugin and Service as the core assembly units.

The post suggests that established server-side engineering patterns—dependency injection, module boundaries, lifecycle management, scoping, AOP and event-driven design—are being systematically applied to Agent Runtimes as agent systems grow more complex, making DSH's design a useful reference for builders.

Original · 小胡子哥

最近看 DeepSeek Harness 的源码,越看越觉得熟悉。它本质上是一个面向 Agent Runtime、支持动态插件生命周期的 IoC 模块系统。之前在公司也参与过企业级 Node.js 框架 Tegg 的设计,两者在很多架构思路上有着非常相似的地方。

Tegg 通过 SingletonProto()、ContextProto() 声明对象的作用域和访问级别,通过 Inject() 管理对象依赖;DeepSeek Harness 则通过 Service 注册和 inject,建立能力提供者与消费者之间的依赖关系。

Tegg 为对象提供了一套细致的生命周期:postConstruct → preInject → postInject → init → preDestroy → destroy;DeepSeek Harness 则通过 Fiber 管理插件的生命周期,正常情况下经历 PENDING → LOADING → ACTIVE → UNLOADING → DISPOSED,并通过 Effect 管理插件注册的资源和副作用。

Tegg 会解析模块间的依赖关系,管理访问级别、对象作用域和循环依赖约束;DeepSeek Harness 同样通过依赖关系组织运行系统,只是核心装配对象变成了 Plugin 和 Service,并进一步支持依赖驱动的动态加载、卸载和重新装配。

依赖注入、模块边界、生命周期、作用域、AOP、事件驱动、动态组合,这些思想在成熟的服务端框架中已经实践多年。如今,随着 Agent 系统的复杂度不断提升,这些经典的软件工程思想又开始在 Agent Runtime 中得到系统性的应用。

DSH 的设计,还是蛮有参考价值的,👍

Industry Coordinates & Source Verification

This report is categorized under AITOP's "Papers" desk, focusing on China's AI industry and domestic foundation model ecosystem. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include DeepSeek, DeepSeek Harness, agents, dependency injection.

Source attribution: curated from 小胡子哥 (@Barret_China).