dsh-page-refresh: Auto-Refresh on Client-Side Plugin Changes

Introduction

When developing client plugins with DeepSeek Harness (DSH), after modifying client.js, the page still runs the old code and you have to manually press F5. The DSH Host side already watches for file changes and recomposes the bundle, but the browser is still executing the stale code — one extra refresh step is needed.

dsh-page-refresh solves this final step: it automatically refreshes the page when the server-side bundle fingerprint changes, while also providing manual trigger and on/off controls.

What It Is

dsh-page-refresh is a DSH client plugin maintained by KeHua000. It detects changes in client plugin code by comparing the bundle revision returned by the server with the revision recorded at page launch, and triggers a page refresh when a change is detected.

Core Features

The plugin implements auto-refresh through the following flow:

  1. Every 2.5 seconds, it sends a GET /page-refresh/state request to fetch the current server-side bundle revision (rev).
  2. The returned rev is compared against window.__DSH_BOOT__.rev recorded at page launch.
  3. When the two differ, it means the client plugin bundle has been updated. It first sends a GET /page-refresh/recompose request to let the Host recompose the bundle, then performs a full page refresh.
  4. A refresh button at the bottom of the sidebar allows manually triggering the same flow at any time. When an update is pending, a small dot appears on the button.
  5. Under “Settings → General,” there is a “Page Auto Refresh” toggle. Turning it off disables auto-refresh, but the manual button remains available.
  6. The assistant can proactively request a page refresh via the refresh_page tool, using the same SSE channel — no manual click required.

Installation & Activation

There are two installation methods:

Method 1: Link (Recommended)

  1. In Harness, go to “Settings → Plugins → Install.”
  2. Paste the tgz link for the current version (available on the Releases page).
  3. After installation, you must manually refresh the page once for the plugin to load. It will handle subsequent refreshes on its own.

Method 2: Local Directory

  1. Clone the repository locally.
  2. Enter the absolute path of the repository in the install field. It will be installed via link:, so code changes take effect immediately.

Behavior Details

Item Behavior
Polling interval 2.5 seconds
Trigger condition Server rev differs from the rev at page launch
Auto-refresh cooldown 15 seconds, to prevent cascading refreshes
Background tabs Paused; refresh resumes when the tab returns to the foreground
Toggle location Settings → General → “Page Auto Refresh”
Toggle storage Browser localStorage (dsh-page-refresh.auto, enabled by default)
Manual button Bottom of sidebar (above the gear icon); a small dot appears when an update is pending
Assistant trigger Tool refresh_page (reason is displayed on the page), or GET /page-refresh/reload?reason=…
Channel GET /page-refresh/events (SSE, with ready + reload frame types); disconnections are auto-reconnected by EventSource, with the 2.5-second polling seq as a fallback during reconnection

Use Cases & Notes

This plugin only responds to client bundle changes. Pure Host-side changes (index.js) require restarting the plugin or reopening Harness and will not trigger a refresh.

Requires Harness version 0.2.2-rc.1 or later to ensure clientModules.graph().rev and window.__DSH_BOOT__.rev are available.

The refresh is a full page refresh: conversations and sessions are preserved, but temporary state in React components (expand/collapse states other than input box drafts) will be lost.

Auto-refresh only takes effect when rev has stabilized (the same new rev must be observed in 3 consecutive polls, approximately 7.5 seconds). The same rev triggers at most one refresh, and two auto-refreshes are at least 60 seconds apart, to avoid rapid cascading refreshes during code edits. Assistant-initiated refresh_page calls are not subject to this rate limiting.

The plugin runs with the current dsh process permissions. It is recommended to review the source code and license before installation.

Conclusion

dsh-page-refresh enables automatic page refresh after client plugin code changes, eliminating the need to manually press F5. It is ideal for high-frequency use during development and debugging.

  • Plugin directory: https://www.skillhub.cn/plugins/KeHua000/dsh-page-refresh
  • GitHub: https://github.com/KeHua000/dsh-page-refresh
羽毛球分组比赛记分
小程序二维码

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

Xiaoye