BrainZombie/dsh-restart-win ↗★ 0
@brainzombie/dsh-restart-win
Safe, verified restart of a DSH Web host on Windows: port-based instance discovery, fail-closed preflight, detached restart with a result file, and four host tools (win_restart / win_restart_status / win_restart_preflight / win_restart_result).
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:BrainZombie/dsh-restart-winREADME
Read the full README ↗7. Configuration
Configuration lives under the plugin row's config in cordis.patch.yml (or in the host's plugin settings UI). The defaults are exactly the behaviour the engine already had on Windows.
| Key | Type | Default | Meaning |
|---|---|---|---|
profile | string | web | DSH profile being restarted |
port | integer | 3080 | Host port; also the mutex name and the discovery key |
bindHost | string | 127.0.0.1 | Address used for probes and status display. Changing it does not change the host's listen address (see §8) |
dshHome | string | '' | Empty = %DSH_HOME%, then %USERPROFILE%\.dsh |
stateDir | string | '' | Empty = %DSH_RESTART_HOME%, then %LOCALAPPDATA%\dsh-restart. Keep the default to reuse existing logs, boot records and resume notices |
taskName | string | DSH Restart | Scheduled-task name (used by -ViaTask / -RegisterTask / -UnregisterTask) |
pwshPath | string | '' | Empty = auto: pwsh first, then powershell.exe |
readySec | integer | 90 | Wait budget for the restarted host to become ready |
verifyReadySec | integer | 150 | Readiness budget for the isolated verification instance |
graceSec | integer | 3 | Graceful stop grace period |
portFreeSec | integer | 30 | Wait budget for the port to be released |
restartDelayMs | integer | 1500 | The tool returns first, then waits this long before touching the host |
toolTimeoutMs | integer | 30000 | Foreground short-task timeout |
verifyTimeoutMs | integer | 600000 | Budget for a detached verification run (also bounds how long win_restart_result waits) |
injectHostEnv | boolean | true | Whether to inject DSH_UC_PROFILE_NODE_MODULES / NPM_CONFIG_LEGACY_PEER_DEPS into the child process that becomes the host (see 7.1); false starts the engine with DSH_RESTART_INJECT_HOST_ENV=0 so it skips them |
tools.restart | boolean | true | Register win_restart |
tools.status | boolean | true | Register win_restart_status |
tools.preflight | boolean | true | Register win_restart_preflight |
tools.result | boolean | true | Register win_restart_result |
An invalid value fails plugin load with the field name (dsh-restart-win config: : ...); nothing silently falls back to a default.
7.1 The two environment variables injected when launching the host
Before launching the host, the engine writes two variables into the environment of the process it is about to start:
| Variable | Value | Why it exists |
|---|---|---|
DSH_UC_PROFILE_NODE_MODULES | \profiles\node_modules | Plugins live under the profile's node_modules; without an explicit pointer the update checker can install a package into node_modules without updating package.json and pnpm-lock.yaml, so the next install drops it |
NPM_CONFIG_LEGACY_PEER_DEPS | true | The rc host's peer ranges rarely agree; without this flag npm fetching packages in a temporary directory fails with ERESOLVE |
Three things to know:
- Process scope only. The values are set in the engine's own process environment and reach the new host through
Start-Process. Nothing is written at user or machine level, so nothing survives the host and the npm in your own terminal is unaffected. - You can turn it off. With
injectHostEnv: false(defaulttrue) the plugin starts the engine withDSH_RESTART_INJECT_HOST_ENV=0; the engine skips both injections and records askipstep. Use it on a machine that does not need these workarounds — the default reproduces the old behaviour. - Check that nothing leaked into the system (both must print nothing):
[Environment]::GetEnvironmentVariable('NPM_CONFIG_LEGACY_PEER_DEPS', 'User')
[Environment]::GetEnvironmentVariable('DSH_UC_PROFILE_NODE_MODULES', 'User')