DeepSeek Harness Plugin

enterhalf/dsh-web-network-optimizer

Stars ★ 5 Downloads (30d) 649 Category Development & Runtime Added 2026-08-23 npm dsh-web-network-optimizer

Network optimization for the DSH web UI: reduces transfer size with caching and compression to greatly speed up page loading, plus a connection-drop indicator and automatic reconnection. Ideal for users pursuing peak performance or using unstable networks.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-web-network-optimizer

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:enterhalf/dsh-web-network-optimizer

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

中文 | English

⚠️ DEPRECATED — do not install on dsh ≥ 0.1.2

After DeepSeek Harness updated to the latest version (0.1.2-rc.1, npm latest since 2026-09), the official implementation now covers every feature of this plugin. This plugin is no longer needed and no longer maintained:

  • Response compression — @deepseek-ai/dsh-host-webserver ships built-in gzip (profile config compression: gzip, configurable level/threshold), identical behavior on local loopback and remote access;
  • Browser caching — plugin client bundles are no longer served per file; everything goes through the content-addressed combo delivery of @deepseek-ai/dsh-client-modules (/plugins/??…&rev=<content-sha1>) with Cache-Control: immutable: the URL is the content hash, an update always yields a new rev, and a mismatched revision is refused — the cache is always fresh and there is no "cache out of sync" blind spot;
  • Automatic reconnection — the official ConnectionController reconnects with exponential backoff and is offline-aware (navigator.onLine), re-syncing data automatically after recovery.

This plugin was built on the old architecture that predates those features (wrapping each webServer route table entry + per-file client-bundle delivery). On the new architecture it has nothing to wrap and actively conflicts — after this repo's main instance upgraded to 0.1.2-rc.1, installing it broke startup and it was disabled and removed. The plugin is only meaningful on dsh 0.1.x (≤ 0.1.1-rc.2); package.json now limits the allowed dsh versions through peerDependencies to @deepseek-ai/dsh >=0.1.0-rc.2 <=0.1.1-rc.2, so package managers flag the incompatibility.

Users already on dsh ≥ 0.1.2 should uninstall it: dsh plugin --profile <name> remove dsh-web-network-optimizer.

dsh网页端网络优化:通过缓存与压缩技术降低传输,从而大幅提升网页加载速度;同时提供网络断连指示与自动断网重连功能。非常适合追求极致性能或网络不稳定用户使用。

Network optimization for the DSH web UI: reduces transfer size with caching and compression to greatly speed up page loading, plus a connection-drop indicator and automatic reconnection. Ideal for users pursuing peak performance or using unstable networks.

  1. Connection Guard — mobile carriers silently drop the network when the phone goes to the background, leaving the UI "permanently frozen": detected automatically, recovered within 1 second, with connection status shown as a small dot beside the conversation title (green = OK / gray = checking / red pulse = problem) and a manual forced reconnect on click;
  2. Response Compression — every compressible response is served as brotli with gzip as fallback, identical behavior on local loopback and remote access;
  3. Browser Caching — /assets/* and the favicon are content-hashed by filename (an update always yields a new URL), so they are served with Cache-Control: immutable and a second visit transfers almost nothing; plugin client.js (rev= URLs) keeps no-cache and the plugin adds an ETag — every load is a conditional revalidation: unchanged content gets a 304 (header bytes only), changed content is delivered fresh, near-zero traffic and always up to date;
  4. Per-Plugin Traffic Ledger — the Settings → Web Network Optimizer panel shows, in real time, how much traffic each plugin uses per load and in total, how much compression saved, and cache-hit status;
  5. Cache Self-Check — when you suspect the browser cache has not caught up with an update, the panel offers three one-click-copyable DevTools steps for clearing the browser cache manually.

Measured Results

Full GUI load (87 static requests): first-load static traffic 8.1 MB → 1.54 MB (−81%), zero static transfer on a cache-hit second visit; largest API /api/session.list 2.18 MB → 144 KB (−93%).

Connection Guard

After the phone goes to the background, carriers often silently cut the TCP connection. The browser is frozen and never notices the drop: the WebSocket state stays OPEN, and the connection controller believes the connection is healthy. Back in the foreground: the UI still looks "alive", but all real-time data is dead — you cannot tell "it is not moving" from "my network dropped".

This plugin actively probes the real connection state when the page returns to the foreground (and on a 30-second heartbeat); when it finds the old connection is dead while the network and the server are both alive, the server destroys the old connection and the controller follows its existing reconnect logic. Recovery keeps the page's in-memory state intact — drafts, scroll position, and in-progress input all survive, and the frozen UI "comes back to life" on its own.

What you see

A small dot is always shown to the left of the conversation title — color is the status, hover expands the text:

Dot Meaning
🟢 Green Connection healthy
⚪ Gray Checking / reconnecting
🔴 Red (pulsing) Offline / problem / recovering
🟢 Green ("recovered ✓") Reconnect complete, returns to solid green after 5 seconds

Clicking the dot = manual forced reconnect — whenever you suspect it is stuck, one click gives a definite result.

Installation

dsh plugin --profile web add dsh-web-network-optimizer@latest

Uninstall:

dsh plugin --profile web remove dsh-web-network-optimizer

Uninstalling restores the route wrapping completely; the ledger file is kept in ~/.dsh/storages/dsh-web-network-optimizer/ for review, and orphaned cache is reclaimed by the browser's own quota.

Cache semantics: /assets and the favicon rely on content-hashed filenames — on update, changed content → new filename → new URL, so the old cache is naturally invalidated and immutable is safe; plugin client.js uses no-cache + ETag — every load revalidates conditionally (304 if unchanged, fresh content otherwise), which does not depend on URL changes and eliminates the "cache out of sync" blind spot (immutable means the browser never requests again, so no server-side technique can keep up with file changes — it is therefore reserved for filename-hashed resources only).

Cache self-check: extreme cases (a misbehaving browser cache, a rewriting proxy, etc.) can still leave stale content behind. Browsers expose no JavaScript API to clear the HTTP cache, so the panel's Cache Self-Check section lists three one-click-copyable DevTools steps (right-click the reload button → "Empty Cache and Hard Reload" / Network panel → "Disable cache" / Application panel → "Clear site data") — pick one and execute it manually once.

Development

npm run build          # validate and produce lib/index.js
npm run build:client   # validate and produce lib/client.js
dsh plugin --profile web add /path/to/dsh-web-network-optimizer   # install from a local directory (development)

License

MIT

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.