$dshubuser@dshub:~/plugins$
  • Plugins
  • Submit
  • Blog
Cordis Inside DeepSeek Harness: Making Everything a Plugin
2026/08/29

Cordis Inside DeepSeek Harness: Making Everything a Plugin

Trace dsh-base, Context services, event domains, and the tool pipeline to see how Cordis organizes a replaceable Agent runtime.

The end state: DeepSeek Harness does not keep one giant agent loop and attach a few extensions beside it. Models, tools, sessions, Agents, and entry points all enter as Cordis plugins.

Once this is clear, cordis.patch.yml stops looking like a package list. It becomes a topology for how product capabilities enter the runtime.

01 / A profile boots a composition tree

DeepSeek Harness profile composing bundles and patch layers into a Cordis plugin tree

A running dsh is a plugin tree assembled from configuration layers. Bundles insert base rows; profile patches and user overlays modify them by id.

dsh-base is the first layer of every profile. It contributes model adapters, tools, persistence, sandbox, approval policy, settings, credentials, and telemetry. Web and headless modes add their own compositions on top.

Print the tree that the machine will boot:

dsh --profile web --dump-config

02 / Services connect capability seams

DeepSeek Harness capability seams showing service definition provider and consumer roles

Common Context services in Harness include:

ServiceCapabilityTypical extension
ctx.toolsTool registry and execution pipelineRegister tools; listen to tools/*
ctx.llmMessages, streams, and model adaptersReplace providers; listen to llm/*
ctx.agentsLive Agents and agent eventsCreate Agents; attach to agent/*
ctx.sessionsDurable session event logObserve session/event; derive UI
ctx.agentLoopDefault Agent driverReplace it through composition

Each capability seam needs a Service Definition, Provider, and Consumer. Keeping those roles separate is what lets one provider change without forking the product.

03 / How a tool plugin enters the real pipeline

import type { Context } from '@deepseek-ai/cordis'
import { defineTool } from '@deepseek-ai/dsh-tools'

export const name = 'greet-tool'
export const inject = ['tools']

export function apply(ctx: Context) {
  ctx.tools.register(defineTool({
    name: 'greet',
    description: 'Greet the named person.',
    parameters: {
      name: { type: 'string', required: true },
    },
    output: {
      schema: { type: 'string' },
      render: (_args, value) => [{ type: 'text', text: String(value) }],
    },
    async execute(args) {
      return 'Hello, ' + args.name + '!'
    },
  }))
}

This plugin reuses every concept from the series: inject waits for the tool service, the registration disposer belongs to the Fiber, and result events let other plugins observe execution.

DeepSeek Harness tool plugin path from inject and register through execution and result events

The tool is not a side channel called specially by the agent loop. It enters the same registration and execution service through ctx.tools.

04 / Events keep the runtime extensible

Harness organizes events by runtime domain:

  • session/event records durable facts, allowing UI, projections, and telemetry to derive from one log.
  • agent/* carries live Agent coordination and request interception.
  • tools/* connects pre-execution, execution, and result stages.

When changing model-request or tool policy, attach to the owning event instead of editing the agent loop. A waterfall listener must call next() to delegate downstream.

05 / What “no privileged kernel” means

The agent loop itself is mounted by configuration. A model provider can change, tools can be added, session storage can use another provider, and HMR can reload plugins while the process runs.

This is not a promise that anything can change arbitrarily. Each extension still follows its service types, event mode, configuration schema, and lifecycle. Replaceability comes from explicit connection points, not hidden global state.

06 / The shortest path to a DSH plugin

  1. Choose the service or event you need; do not start by editing the loop.
  2. Write a function plugin exporting name, required inject, optional Config, and apply.
  3. Keep registrations and listeners in the current Fiber’s effect system.
  4. Insert a row or patch a stable id in the profile’s cordis.patch.yml.
  5. Boot through Loader and observe real service output and teardown.

Conclusion

Cordis gives DSH four verbs: compose, connect, own, reverse. A profile selects plugins, Context connects capabilities, Fiber owns instances, and Effects reverse side effects.

“Everything is a plugin” is therefore not a slogan. It is a runtime organization that can be traced through configuration, services, events, and lifecycle.

Continue with Composition and HMR, Events, and waterfall.

Sources: Harness architecture, into-the-Harness tutorial, dsh-base composition, and tool execution pipeline.

All Posts

Author

avatar for DSH Research
DSH Research

Categories

  • Agent Infrastructure
01 / A profile boots a composition tree02 / Services connect capability seams03 / How a tool plugin enters the real pipeline04 / Events keep the runtime extensible05 / What “no privileged kernel” means06 / The shortest path to a DSH pluginConclusion

More Posts

Composition and HMR: Import New Code, Dispose the Old Fiber, Then Activate
Agent Infrastructure

Composition and HMR: Import New Code, Dispose the Old Fiber, Then Activate

Understand stable ids, configuration groups, and Cordis HMR’s unload-reload cycle, including how to diagnose plugins stuck in PENDING.

avatar for DSH Research
DSH Research
2026/08/28
Configuration: Give Plugins Validated Options and Defaults
Agent Infrastructure

Configuration: Give Plugins Validated Options and Defaults

Define Cordis plugin configuration with Schemastery and see how defaults, path-aware errors, and FAILED Fibers prevent a sick start.

avatar for DSH Research
DSH Research
2026/08/27
Services and Context: Share Capabilities Without Binding Implementations
Agent Infrastructure

Services and Context: Share Capabilities Without Binding Implementations

Use Service, Context, and declaration merging to understand how providers, consumers, and scopes connect DeepSeek Harness capabilities.

avatar for DSH Research
DSH Research
2026/08/22

Newsletter

Join the community

Subscribe to our newsletter for the latest news and updates

[dshub] [zsh]$ dshub ls$ dshub submit$ dshub blog
-- NORMAL -- ✓ 2026 dshub