Rebuild a DSH profile with --from-default-profile

Update & UpgradePublished 2026-10-21Author: DeepSeek Plugin Market
DeepSeek Harnessprofilefrom-default-profilerollbackdsh rescue
DSH --from-default-profile rebuilds a profile from a bundle template, deleting dependencies and patches. It stages first and keeps a previous copy on failure.

--from-default-profile does not “upgrade” a profile; it replaces the directory with a fresh template copy. The new profile keeps only the template’s current bundle list, and everything in the old directory—dependencies, user patches, local edits—is deleted. It is the right tool when a custom profile is broken or badly drifted, not when you want to preserve configuration.

DeepSeek Harness: What is replaced and what survives

The boundary is hard: template content stays, old directory content disappears. Compare:(source)

ContentAfter rebuild
Template’s current bundle listWritten into the new manifest
Installed dependenciesCleared
User cordis.patch.ymlCleared
Inherited fields from the old profileNot preserved
Bundled bundlesStill resolve from the current dsh install

The new manifest has empty dependencies and an empty user patch. It does not read a local template profile of the same name, does not copy its dependencies or patches, and does not persist inherited fields. Later changes to the template list do not rewrite the new profile.

That is why this is a reset, not an upgrade. If you want to keep plugins and only refresh the base combination, edit dsh.profile.bundles or reinstall plugins instead.

DeepSeek Harness: Three situations where it fits

It fits when the target profile is no longer trustworthy and a clean template is the fastest way back. Three cases:(source)

  1. Rescue profile — dsh rescue --from-default-profile web rebuilds rescue from the web template. Expected: a clean, startable Web profile.
  2. Reproduce default behavior — rebuild a suspect profile and compare. Expected: rule out local configuration.
  3. Discard an experiment — reset a failed profile instead of cleaning it item by item. Expected: a fresh template, then reinstall what you need.

If you only need a new profile, create one directly with a new name; the flag is destructive only when the target already exists.

DeepSeek Harness: Command and execution order

The launcher stages first, moves second, and deletes the old directory last; that order explains why recovery is possible. The chain:(source)

  1. Validate the target name — it cannot be a bundled profile name in any case. Expected: use a custom name such as rescue.
  2. Assemble in staging — create .staging-* next to the target and write the template copy. Expected: the old directory stays usable during assembly.
  3. Move into place — move the new directory to the target, then delete the old one. Expected: one complete copy at the target.
  4. Commit before startup — replacement finishes before bundle resolution and app startup. Expected: a later startup failure does not roll back.

Example:

sh
# Rebuild the custom rescue profile from the web template
dsh rescue --from-default-profile web

# Start it normally afterward
dsh rescue

Success does not print an extra “replaced” message; do not re-run the command just because the output is quiet.

DeepSeek Harness: Failure and rollback

The official recovery has two levels: automatic restore on move failure, then a previous directory if restore also fails. The order:(source)

  1. Move fails — the launcher tries to restore the old directory. Expected: the target is still the old profile.
  2. Restore fails — the old directory stays under $DSH_HOME/profiles/.<name>.staging-*/previous. Expected: you can move it back manually.
  3. Process stops between renames — a previous directory is also left behind. Expected: do not clear .staging-* before checking it.
  4. Concurrent replacements — at least one succeeds and the target keeps one complete copy. Expected: do not run multiple rebuilds in parallel.

Manual recovery:

sh
ls -d "$DSH_HOME"/profiles/.rescue.staging-*/previous
# Confirm package.json and cordis.patch.yml exist before moving it back
mv "$DSH_HOME/profiles/.rescue.staging-xxxx/previous" "$DSH_HOME/profiles/rescue"

Rename the incomplete new directory before deleting it. If the previous copy is also incomplete, deleting both loses everything.

DeepSeek Harness: When not to use it

If the goal is “keep configuration while upgrading”, this is the wrong tool. Three alternatives:(source)

  1. Update the bundle list — edit dsh.profile.bundles and restart. Expected: dependencies and patches survive.
  2. Reinstall specific plugins — dsh plugin --profile <name> add/update. Expected: only plugins change.
  3. Clear one patch file — rewrite or remove cordis.patch.yml. Expected: installed dependencies remain.

Even when a rebuild is necessary, back up the whole profile first. The previous-directory recovery covers replacement failures, not “I rebuilt and only then remembered I needed the old config”.

DeepSeek Harness FAQ

Why is the plugin list empty after a rebuild? The new manifest has empty dependencies and only the template bundles. Reinstall plugins and restart.

Can I use this flag on web itself? No. The target cannot be a bundled profile name. Create a custom name with the web template, for example dsh web2 --from-default-profile web.

Does a failed startup restore the old profile? No. Replacement commits before startup; a later failure leaves the new profile. Recover manually from the previous directory.

The short version: --from-default-profile rebuilds, it does not upgrade. Back up first, and use it only when clean-slate is the goal.

FAQ

Is --from-default-profile an upgrade or a reset?

DeepSeek Harness: it is a rebuild. DeepSeek Harness replaces the target profile with a fresh copy of a bundled template. The new manifest keeps only the template’s bundle list; existing dependencies and user patches are deleted. It stages the new copy before moving it into place.

Which profiles cannot be replaced with --from-default-profile?

DeepSeek Harness: the target cannot be web, headless, sdk, sdk-minimal, or acp in any case variant. The flag is for a custom target, for example dsh rescue --from-default-profile web, which rebuilds the custom rescue profile from the web template.

Can I recover the old profile if the rebuild fails?

DeepSeek Harness: if the move fails, the launcher tries to restore the old directory. If that also fails, or the process stops between renames, the original is kept under $DSH_HOME/profiles/.<name>.staging-*/previous for manual recovery.

Why are plugins and configuration gone after a rebuild?

DeepSeek Harness: that is expected. The new profile has empty dependencies and an empty user patch; only the template bundle list is written. Reinstall plugins and rewrite configuration. Bundled bundles still resolve from the current dsh installation.

If the rebuilt profile fails to start, does the old profile come back?

DeepSeek Harness: no. The replacement commits before bundle resolution and application startup, so a later startup failure leaves the new profile on disk. Use the previous directory to recover manually.

Related Terms

--from-default-profile
--from-default-profile is a dsh startup flag that replaces a custom profile with a fresh copy of one of five bundled templates before startup, deleting the target’s dependencies and user patches.— DeepSeek Harness reference - dsh CLI behavior
staging directory
A staging directory is created next to the target profile so the launcher can assemble a complete new profile before moving it into place. On failure, the old directory may remain under .staging-*/previous.— DeepSeek Harness reference - dsh CLI behavior
dsh.profile.bundles
dsh.profile.bundles is the ordered bundle list in a profile manifest. A template rebuild writes only the template’s current list and does not copy old dependencies.— DeepSeek Harness reference - dsh CLI behavior
dsh rescue
dsh rescue is the custom profile name used in the official example, commonly paired with --from-default-profile web to create a clean, startable rescue profile.— DeepSeek Harness reference - dsh CLI behavior

Sources