DeepSeek Harness (DSH) adopts a plugin-based architecture, and the restart function in the Web interface is a common need in daily development and debugging. dsh-better-restart is a community-maintained plugin that adds an “in-place restart” capability to the DSH Web interface and provides a confirmation mechanism before restarting.

Core Features

The plugin consists of a host-side part and a client-side part, implementing functionality through interaction between the browser and the Node process.

  • Host side: Exposes two endpoints via webServer.
    • POST /better-restart/status: Queries the current runtime status of the Agent.
    • POST /better-restart: Performs the restart operation. It prefers the appRestart service provided by the launcher (returns 204); if unavailable, it falls back to Root-include recompose mode (returns 202).
  • Client side: Adds a Restart app button in the settings bar.
    • Confirmation mechanism: After clicking, a dialog appears and polls the Agent’s activity status every 1.5 seconds. If a conversation is currently running, explicit confirmation is required before restarting; if no conversation is running, it proceeds directly.
    • Status feedback: Displays a loading animation and disables the button during the restart process.
  • Service interface: Exposes status() and restart() methods to other browser plugins through the betterRestartUi Cordis service.
  • No dependencies: The plugin is fully self-contained at runtime, with no dependencies other than Node.js built-in modules.

Installation and Activation

Before installing, make sure you have Node.js 22.19+ or 24+ and pnpm 11 installed.

If you have already checked out the DeepSeek Harness source code, you can run the following commands directly in the source directory:

git clone --depth 1 --branch dsh-v0.1.2-rc.1 https://github.com/deepseek-ai/deepseek-harness.git
cd deepseek-harness && pnpm install && pnpm run build
pnpm dsh plugin --profile web add -w github:lovstudio/dsh-better-restart#v0.1.4
pnpm dsh web

Option 2: Install without source code

If you only need to use the plugin and do not need the Harness source code, you can install it directly using npx:

npx @deepseek-ai/dsh plugin --profile web add -w github:lovstudio/dsh-better-restart#v0.1.4
npx @deepseek-ai/dsh web

Usage Steps

  1. Start the Web UI: run dsh web.
  2. Find the Restart app button in the settings header.
  3. After clicking it, a confirmation dialog appears. After confirmation, the application restarts in place, and the current browser tab refreshes automatically.

Technical Details and Notes

  • Dependency requirements: The plugin depends on webServer and agents from @deepseek-ai/dsh-base. appRestart and loader are optional dependencies; if both are unavailable, the restart operation returns a 503 error.
  • Restart mechanism:
    • Preferred: appRestart (process-level restart).
    • Fallback: Root-include recompose. This mode disables and re-enables the Loader’s root cordis:include entry, then reloads the configuration and plugin list. Because the Node process is reused, the terminal remains running, but note that the browser side refreshes only after waiting for the Socket close response (202).
  • ESM cache: Due to Node.js’s ESM caching mechanism, for modules that are already loaded, source editing changes can only be detected through Harness’s HMR listeners.
  • Automatic client loading: The plugin’s client module is automatically injected into the page by the module system after plugin composition; there is no need to rebuild the Web application.
  • Text resources: UI strings are located in the @lovstudio/dsh-better-restart package and are automatically registered under the better-restart-ui locale namespace.

Ecosystem and Origin

This plugin is maintained by Lovstudio and follows the MIT license. It is not an officially maintained DeepSeek package, but it can be integrated and used through the DeepSeek Harness plugin mechanism.