dsh Plugin Remove Bug — DeepSeek Harness Guide
Symptom
Section titled “Symptom”dsh plugin --profile <X> remove <bundle> sometimes leaves a stale entry in dsh.profile.bundles, in the profile’s package.json, after the package itself is already gone from dependencies. The profile then refuses to boot:
dsh: cannot resolve profile bundle "<bundle>" from the dsh installation or <path>;run dsh plugin --profile X install if its dependency is not installedThe message’s own advice doesn’t help. Neither dsh plugin --profile X install nor dsh plugin --profile X ls clears the stale entry. As of the reports below, hand-editing package.json is the only recovery.
Two reporters root-caused this against 0.1.0-rc.6 source, down to line numbers (#913, with a deeper follow-up in #917):
reconcilePlugins()syncsdsh.profile.bundlesagainst pnpm’s realdependencies, and it runs only when the pnpm subprocess exits0. If pnpm writes the manifest and then exits non-zero (reporters saw this with transient network errors duringremove, e.g.ETIMEDOUTagainst a git-hosted bundle source), the dependency is gone frompackage.jsonbut reconcile never ran to strip the matchingdsh.profile.bundlesentry.- From there the stale entry is permanent. The removal branch fires only when
wasDependencyis true, meaning the package showed up independencieseither before or after the pnpm run. With the package gone on both sides,wasDependencyisfalseforever and the branch never fires again. That holds for every laterdsh plugincall,installandlsincluded, since they all funnel through the samereconcilePlugins(). - The fix the error message suggests,
dsh plugin --profile X install, runs that same logic, so it can’t repair this class of stale entry. The message points you at a dead end. - The same reports note a related symptom. On a brand-new profile, the first
dsh plugin addcan also fail to populatedsh.profile.bundles, for the same reason: reconcile skipped on a non-zero pnpm exit. A secondaddbackfills it.
The repro is non-deterministic and network-dependent. One reporter got 4/4 passes rerunning the same flow under controlled conditions, which points at a race with pnpm’s exit behavior rather than a reliable trigger.
Solution
Section titled “Solution”As of these reports, the only confirmed recovery is manual:
- Open the profile’s
package.json(under$DSH_HOME/profiles/<name>/). - Find the stale bundle name under
dsh.profile.bundles. - Delete that entry by hand and save.
- Boot the profile again.
Bundles installed with link: were reported to remove cleanly, since no network operation is involved. The bug needs a removal that makes a network round trip, e.g. a github:owner/repo source.
Source
Section titled “Source”- Discussion #913 — original English report, environment: Windows 11, Node 24, pnpm 11.21.0
- Discussion #917 — independent deeper source analysis citing #913, with exact
plugin-*.js/dsh-app-bootline numbers and three candidate fixes
Related errors
Section titled “Related errors”- Custom session events break session resume — another persisted-state bug with no in-place recovery.
- Windows sandbox crashes after clearing Temp — same rc.6 release, same Windows environment class of bug.
- See Profiles, bundles & patches for how
dsh.profile.bundlesfits into the config model.