AI Agent Hub
Back to plugins
🧩

dsh-optimize

admin-security Updated 2026.09.14

Run the following command in DeepSeek Harness:

dsh plugin install aoripus/dsh-optimize

Paste the following prompt into your AI chat to install this plugin:

Install it in DeepSeek Harness by running dsh plugin install aoripus/dsh-optimize; the source is available at https://github.com/aoripus/dsh-optimize .

About this plugin

The longer a conversation gets, the more quietly expensive it becomes: every agent step re-sends the retained history, the session log grows without bound, and the browser accumulates thousands of live DOM rows. dsh-optimize turns that invisibility into a measurable fact. On each outgoing request it records message count, character count, and an estimated token range, while also reading the Harness contextPressure projection as the authoritative anchor. Per-session totals—request count, event count, peak weight, compaction count—are persisted to a local state file. When a session crosses your warnTokens or criticalTokens threshold, a warning with the measured range appears in the log; if you enable autoCompact, the plugin invokes the Harness compaction engine during an idle window, leaving the summarisation policy to the engine itself. In the browser, it applies content-visibility: auto to long-history rows so off-screen layout and paint are skipped, React reconciliation is unchanged, scroll anchors stay stable, and a single click on the Composer chip or Settings row toggles the mode.\n\nIt does not alter the system prompt, tool schemas, or request prefix; it does not write session events or touch the session log. Its entire footprint is measurement, threshold warnings, and an optional earlier compaction trigger—turning "this long session is getting expensive" from a vague feeling into a logged number.\n\nWho is it for? If your DeepSeek Harness workflows routinely hit sessions in the hundreds of thousands of tokens, or if you want compaction timing governed by your own budget rather than solely by the model context window, dsh-optimize gives you a low-intrusion observability layer plus an opt-in actuator. Administrators can use it for capacity audits; heavy interactive users get a glance at mounted row count and a one-click rendering toggle right in the Composer.

Use Cases

  • Track per-request payload and token growth in real time during a 100k+ token conversation
  • Identify which parallel sessions are approaching compaction thresholds at a glance
  • Reduce browser layout jank when rendering hundreds of history rows with one-click Lite mode

Best For

  • Heavy users running 100k+ token conversations in DeepSeek Harness
  • Platform admins responsible for capacity audits and cost control
  • Frontend developers concerned with long-history browser rendering performance