DeepSeek Harness Installing Plugins and Configuration Load Order
The previous chapter created the hello-plugin bundle; this chapter installs it into a profile.
The installation steps are based on DeepSeek Harness bundles and profiles: two manifests, and you can review the two manifests in that chapter first.
This chapter also answers a key question: when multiple bundles' configurations are layered, which one overrides which.
This is determined by the load order of the effective configuration.
Load Order: Layering of the Effective Configuration
The effective configuration is composed layer by layer on top of an empty root in a fixed order, with later-applied layers winning per line.
The complete order is as follows.
| Order | Layer | Description |
|---|---|---|
| 1 | profile's dsh.profile.bundles List |
Each bundle's patches in list order: first dsh-base, then each installed bundle in its addition order |
| 2 | profile's own cordis.patch.yml |
user profile-level patch layer |
| 3 | home-level $DSH_HOME/cordis.patch.yml |
machine-local preferences shared by all profiles |
| 4 | Each --patch overlay |
In argv order |
Application arguments are not another patch layer.
Surface-level bundles can resolve them through the application's own services.
Later-applied layers win per line, and a patch replaces the entire config value of the target line rather than deep-merging individual keys.
Hands-on: Install hello-plugin into a Profile
dsh plugin --profile It forwards to pnpm within the profile directory, so all pnpm subcommands are available.
In the directory containing hello-plugin, install the package's checkout.
dsh plugin --profile demo add ./hello-plugin
First use initializes the profile.
@deepseek-ai/dsh-base becomes its first bundle.
pnpm links the checkout, and dsh, because this package declares dsh.bundle, appends it to dsh.profile.bundles。
The generated profile's package.json looks roughly like this.
Example
{
"name": "dsh-profile-demo",
"private": true,
"dependencies": {
"dsh-hello-plugin": "link:/path/to/hello-plugin"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"dsh-hello-plugin"
]
}
}
}
The meanings of the fields are as follows.
| Field | Description |
|---|---|
name |
The profile's package name, in the form of dsh-profile-demo |
private |
The profile is used only locally, not published |
dependencies |
Out-of-tree plugin dependency, linked by pnpm to a local checkout |
dsh.profile.bundles |
Ordered bundle list; the load order is the array order here |
First do not launch; verify only that layer, then launch.
dsh --profile demo --dump-config # 会显示一个 "# == dsh-hello-plugin" 层
dsh --profile demo
--dump-config prints the layered effective configuration, used to verify which bundle each layer comes from.
In the output you should see # == dsh-hello-plugin layer markers like this.
Removing a plugin is just as simple.
dsh plugin --profile demo remove dsh-hello-plugin # 同时移除依赖和对应的层
patch Replaces the Entire Line by id
A patch is not a deep merge; it replaces the entire config value of the target line by id.
This brings two implications for bundle authors.
| Merge Method | Behavior | dsh's Choice |
|---|---|---|
| Deep merge | Override only changed keys, other keys are preserved automatically | Not the case |
| Whole-line replacement | Replace the config value by id on a whole line; all keys must be restated | dsh uses |
First, your patch can override lines from earlier layers by id.
Just as the dsh-web-app bundle overrides dsh-base's lines.
But you must restate every key the line needs, not only the one you changed.
Second, users can, in their own profile's cordis.patch.yml , override your lines without modifying your package.
So prioritize giving configuration defaults that users are likely to keep, and leave the rest to the schema.
Built-in bundle names are always resolved from the dsh installation directory itself.
pnpm manages only out-of-tree packages, so your bundle can safely depend on
@deepseek-ai/dsh-basebeing present and consistent with the installation.
Summary and self-test
Installing a plugin is appending to the profile's bundles list a package that declares dsh.bundle , and the effective configuration is layered in the order bundles → profile patch → home patch → --patch overlay.
Self-test questions:
- What is the four-layer load order of the effective configuration?
- When a patch overrides by id, why must all keys be restated?
dsh --profile demo --dump-configWhat is its role?