Fix DSH Python SDK startup: profile, plugin and patch
DeepSeek Harness Python SDK startup is fail-fast: a profile without a JSON-RPC server entry, an unresolved plugin, or an invalid patch stops startup, and none of them fall back to another combination. This is different from a model request that can retry. Configuration-layer failures must be fixed before the SDK can start.
DeepSeek Harness: Three failure classes
The same “SDK will not start” can point at three different layers. Compare:(source)
| Failure | Typical symptom | Check first |
|---|---|---|
| Missing server entry | Profile does not contain a JSON-RPC server | dsh-sdk-app in the profile |
| Unresolved plugin | Package or module cannot be found | bundles and node_modules |
| Invalid patch | YAML error or missing target | cordis.patch.yml and patches |
Read whether the error names the profile, a package, or a patch file before changing anything. Reinstalling the SDK is rarely the first correct move.
DeepSeek Harness: Fix a missing server entry
The SDK does not run on an arbitrary profile; it needs a JSON-RPC server entry. Fix it:(source)
- Use a shipped profile — try
profile="sdk-minimal"orprofile="sdk"to prove the SDK itself works. Expected: a minimal task returns. - Inspect the custom profile — open
$DSH_HOME/profiles/<name>/package.jsonand confirm the bundle list includes SDK-related bundles. Expected: it is not a copy of the web profile. - Add the server entry — insert
@deepseek-ai/dsh-sdk-appor an equivalent JSON-RPC server entry. Expected: startup no longer reports a missing server.
If you only need isolation, create the profile with --from-default-profile from sdk-minimal instead of hand-writing an empty directory.
DeepSeek Harness: Fix an unresolved plugin
Resolution failure usually means “this profile does not have the package”, not “the package is broken”. Check:(source)
- Confirm the profile — the SDK’s
profileargument selects the directory. Expected: you are not looking in the web profile for a sdk-minimal plugin. - Check dependencies —
dsh plugin --profile <name> listor inspect pnpm state. Expected: the package name matches the patch. - Check the patch reference — is the
namean absolute path or a complete package name? Expected: no relative path points at the wrong directory. - Install the missing package —
dsh plugin --profile <name> add <package>. Expected: resolution succeeds.
A package in another home does not come along when you copy a patch. Either install it in the new home or migrate the patch and its dependencies together.
DeepSeek Harness: Fix an invalid patch
DeepSeek Harness patches replace the target row’s entire config, not deep-merge it; that is the most common source of “invalid”. Check:(source)
- Back up the patch — copy
cordis.patch.ymland any file passed throughpatches. Expected: you can restore it. - Keep one patch — temporarily remove the constructor
patchestuple and keep only the profile patch. Expected: rule out conflicts between files. - Restore in pieces — add back one insert or one config block at a time. Expected: identify the failing section.
- Validate with dump —
dsh --profile <name> --dump-config. Expected: dump succeeds before starting the SDK.
Common errors: inconsistent indentation, an insert target that does not exist, half a config object, or an array written as an object. A patch must satisfy the target schema, not just be short.
DeepSeek Harness: Use dump for binary search
Dump is the cheapest pre-start check: it composes configuration and resolves patches and plugins without starting the app. Three uses:(source)
- Dump defaults —
--dump-default-config. Expected: the template itself is valid. - Dump effective config —
--dump-configwith the same--patch. Expected: reproduce the failure in the configuration layer. - Dump schema —
--dump-config-schema. Expected: confirm field names and types.
If dump succeeds but the SDK fails, return to the profile server entry. If dump fails, fix the file and target named on stderr.
DeepSeek Harness: Minimal profile structure
Confirm the profile is not just an empty directory. A startable SDK profile needs:(source)
package.json— adsh.profilemanifest with a bundle list that references SDK bundles.cordis.patch.yml— may be empty, but must parse as YAML.- Resolvable dependencies — every bundle package exists in the profile’s node_modules or the built-in install.
Check with:
dsh --profile sdk-minimal --dump-config >/tmp/sdk.yml
A successful dump means the configuration composes. If it fails, fix the patch or dependency before touching Python code.
Minimal reproduction experiments
Change one variable at a time instead of editing three layers at once. Three experiments:
- Profile only — run the same Python code with
sdk-minimal. Expected: success means the SDK and environment are fine; the custom profile is the problem. - Remove patches — keep the profile, drop the constructor
patchestuple. Expected: startup means the per-run patch is invalid. - One plugin at a time — comment out all but one insert in the profile patch. Expected: narrow to the failing package or row.
Back up cordis.patch.yml and package.json before each experiment. Three runs usually identify the layer.
After fixing, check four things: the same profile starts three times, a minimal task returns text, dump provenance matches expectations, and session logs still go to the original home.
DeepSeek Harness FAQ
Can the SDK automatically fall back to sdk-minimal on startup failure? No. The official behavior is to fail on a missing server entry, an unresolved plugin, or an invalid patch. If you need a fallback, catch the exception in your application and switch profiles explicitly.
Is deleting the whole home the fastest recovery? It recovers, but loses sessions, plugins, and configuration. Back up first, rebuild only the profile, or validate the SDK in a new home.
The patch is correct, but another machine fails to start—why? Dependencies do not travel with a patch. Install the packages in the target profile on that machine.
The short version: SDK startup failures are profile, plugin, or patch—none self-heal. Use dump to find the layer, then fix that layer only.
FAQ
DeepSeek Harness: the SDK requires a profile containing @deepseek-ai/dsh-sdk-app or another JSON-RPC server entry. Without it, startup fails and does not fall back to sdk-minimal. Use a shipped profile or add the server entry to your own profile.
DeepSeek Harness: the profile bundle list or a patch references a package the current environment cannot resolve. Common causes are a missing plugin, a wrong package name, or a patch pointing at another home’s plugins. Confirm the dependency in the target profile.
DeepSeek Harness: no. DeepSeek Harness fails startup on a missing server entry, an unresolved plugin, and an invalid patch; it does not fall back to another combination. Invalid patches include YAML syntax errors, missing insert targets, and an incomplete config replacement.
DeepSeek Harness: run dsh --profile <name> --dump-config. If dump fails, the problem is likely a patch or plugin resolution. If dump succeeds but the SDK still fails, inspect the profile’s JSON-RPC server entry. Remove the patches tuple for a control run.
DeepSeek Harness: it does not intentionally rewrite configuration, but it can leave a profile half-initialized. Back up cordis.patch.yml and package.json before experimenting; do not delete the whole home as a first step.
Related Terms
- JSON-RPC server entry
- A JSON-RPC server entry in a DeepSeek Harness SDK profile declares the stdio JSON-RPC service. A profile without @deepseek-ai/dsh-sdk-app or an equivalent entry cannot start the SDK.— DeepSeek Harness docs - Python SDK
- invalid patch
- An invalid patch is a DeepSeek Harness configuration patch that cannot be parsed or applied, such as a YAML error, a missing target, or a replacement with an incomplete config. It fails startup rather than being skipped.— DeepSeek Harness reference - dsh CLI behavior
- profile
- A profile is a startable DeepSeek Harness configuration at $DSH_HOME/profiles/<name>, containing package.json and cordis.patch.yml. The SDK selects it with the profile argument.— DeepSeek Harness docs - Python SDK
- dsh.profile.bundles
- dsh.profile.bundles is the ordered bundle list in a profile manifest. A reference to a missing package causes resolution failure at startup.— DeepSeek Harness reference - dsh CLI behavior
Sources
- DeepSeek Harness docs - Python SDK· deepseek-ai
- DeepSeek Harness reference - dsh CLI behavior· deepseek-ai