dsh-gui-control: DSH Web Interface Force Refresh and Harness Restart

Introduction

When developing client-side plugins or modifying Host-side code in DeepSeek Harness (DSH), common issues include: after changing lib/client.js, the UI still shows old behavior, or after installing a new plugin or upgrading, you need to restart the Host for the new generation of code to load. A simple browser refresh or Ctrl+F5 often fails to completely clear CacheStorage, residual Service Workers, and the in-process memory of already-loaded client bundles; meanwhile, restarting the Harness involves the desktop shell process, so you cannot expect to accomplish this by calling an API from within the page.

dsh-gui-control (maintainer ccccwwwxx) is a DSH plugin categorized as “client-side”: it provides Hard Refresh UI and Restart Harness actions in the Web GUI, with three entry points sharing the same hardReload() / restartHarness() implementation. The current version of the plugin is 0.2.0 (MIT); see the community directory at SkillHub plugin page, and the source code and documentation at GitHub repository. The DSH ecosystem emphasizes “everything is a plugin”; SkillHub and similar platforms are community directories with no official affiliation with DeepSeek / High-Flyer.

What This Is

In one sentence: Adds one-click controls for hard refresh and Harness restart to the DSH Web GUI, and displays Host running status in the settings page (plugin version, Host pid, uptime, platform, Profile).

The two actions solve problems at different layers:

Hard Refresh UI Restart Harness
What it does Clears CacheStorage, unregisters Service Workers, then reloads the entire page, re-fetching and executing every client plugin bundle Restarts the Host process via the DSH Desktop preload bridge (window.dshDesktop.restartHarness → main process IPC harness:restart), then reloads the page
When to use After changing client-side plugin code (lib/client.js) with no effect; UI stuck on an old plugin list; style glitches After changing Host-side (Node half) code; installing/upgrading plugins; need to reload a Profile
Impact Only reloads this page; the Host process is unaffected The Host restarts, running tasks will be interrupted
Availability Any carrier (desktop / browser) Only in the DSH Desktop window (in the browser the button is disabled with an explanation)

The Host side has no—and should not have—“restart itself” escape hatch; that is the supervision responsibility of the desktop shell. In the browser version, this plugin disables restart and explains the reason.

Three Entry Points

The following three UI locations invoke the same pair of functions; there is no second implementation.

  1. Top-right of the conversation header: two 24px icon buttons, placed to the left of the official three buttons (Open in App / Session Log “More” / Right Panel Expand), with an extra 8px gap between them. The icons have no text; semantics are in aria-label / title; when restart is “armed”, the icon turns red and a tooltip bubble floats below it (absolutely positioned, not pushing this row).
  2. Bottom of the sidebar: two one-click entries (in expanded state, “icon + text” full row; in collapsed state, 32px icon buttons).
  3. Settings → UI Controls: running status panel, two actions and their descriptions.

Slot registrations (for understanding extension mechanisms): conversation.session.header.utilities (gui-control-header-refresh / gui-control-header-restart), sidebar.footer.action (gui-control-refresh / gui-control-restart), settings.section (gui-control). The conversation header uses negative order values to be placed to the left of the official buttons.

Differences Between Hard Refresh and the Browser’s “Hard Reload”

Page scripts cannot change the cache mode of the document itself, so they cannot obtain the browser-level hard reload flag. This plugin overrides three common sources of staleness:

  1. Cache entries in CacheStorage (deleted one by one);
  2. Residual Service Workers (unregistered one by one);
  3. The in-process memory of client module factories (cleared by a full page reload).

The plugin bundle URL carries a rev= parameter; the Host side caches bytes by revision, so the latest artifact is usually obtained after a reload; clearing the cache is an additional safeguard.

Two-Step Confirmation for Restart

Restart is a destructive action: it interrupts running tasks and tool calls. Therefore, native confirm() (which blocks the renderer process) is not used; instead, a two-step confirmation is implemented: the first click only “arms” it (the settings page/sidebar button becomes “Confirm restart?” and turns red; the conversation header icon turns red and a tooltip appears); only a second click within 4 seconds executes it, and it automatically cancels if the timeout is exceeded.

Installation and Activation

All three installation methods have the same effect; each writes to dsh.profile.bundles in profiles/<profile>/package.json. The repository already contains the committed lib/client.js, so no build step is needed when installing from GitHub.

1. Install from GitHub repository (recommended)

dsh plugin --profile web add github:ccccwwwxx/dsh-gui-control

2. Install from a Release pre-built package (no build, no allowBuilds authorization required)

dsh plugin --profile web add https://github.com/ccccwwwxx/dsh-gui-control/releases/latest/download/dsh-gui-control.tgz

3. GUI / local directory (for development)

In Settings → Plugins → Add Plugin, enter the absolute path of the local directory; the installation flow uses pluginManager.installBundle, which writes to the profile manifest after staging validation.

Uninstall:

dsh plugin --profile web remove dsh-gui-control

After installation

  • First install: The client half generally takes effect directly via HMR; the two entries will appear in the conversation header and sidebar; if they do not, click “Hard Refresh” once.
  • Upgrade install: The plugin manager may report application: "restart-required"; the new generation of Host code requires a restart to load. You can use this plugin’s “Restart” or the Restart Harness in the menu, and the page will reload afterwards.

It is recommended to read the repository source code and the MIT license before installation; the plugin runs with the current dsh process permissions. As with any DSH plugin, you should evaluate for yourself whether it is suitable for your environment.

Typical Usage

  1. Changed client-side plugin code but the UI did not update: Click “Hard Refresh UI” at the bottom of the sidebar or in the conversation header, or open Settings → UI Controls to perform the same action.
  2. Changed Host-side code, just upgraded plugins, or need to reload a Profile: Use “Restart Harness” in the DSH Desktop window and complete the two-step confirmation; do not expect the restart button to be usable in a browser carrier.
  3. Want to check the current Host status: View the plugin version, Host pid, uptime, platform, and Profile in Settings → UI Controls. Note: the “Host uptime” in the status is counted from the moment the module was loaded, not from the OS process creation time; under normal startup, the two are close.

Use Cases and Notes

This is suitable for developers who frequently iterate on DSH client/Host code locally or in Desktop, and do not want to repeatedly manually clear caches or hunt for menu restarts. Hard Refresh only affects the current page; Restart interrupts ongoing tasks, so confirm before using that no critical sessions depend on the Host continuing to run.

Known limitations (from the repository documentation): Hard Refresh is not equivalent to the browser’s hard reload flag; the browser version has no restart capability; the cost of restart comes from the Host restart itself, not from additional plugin design.

Conclusion

dsh-gui-control consolidates “clear cache + full page reload” and “Harness restart under desktop shell supervision” into three GUI entry points, and unifies them with two-step confirmation, reducing trial-and-error costs after plugin modifications. Directory and installation instructions: SkillHub; source code and detailed contracts: github.com/ccccwwwxx/dsh-gui-control.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye