dsh-plan-compact-execute: Adding Compact then Execute to DeepSeek Harness Plan Approval

spookywaste/dsh-plan-compact-execute

Tools & CapabilitiesVerified
Listed on 2026-09-29
Page last updated 2026-09-30

Adds a "Compact & Execute" option to the DSH Web client's plan-mode approval card: it compacts the pre-plan context into a summary checkpoint, then approves the plan so the model executes with the plan kept verbatim.

dsh-plan-compact-execute is an approval enhancement plugin for the DeepSeek Harness Web client that adds a "Compact then Execute" option to the plan-mode approval card. It targets a real pain point: plan approval happens inside a tool call while the agent is mid-turn, so the usual compaction command cannot step in, leaving long contexts with no clean way forward. The plugin first compacts the exploration history from before the plan was submitted into a summary checkpoint, then answers the pending question with the question's own approval label so plan mode exits right away. The plan body, the approval text, and any unfinished tool batch stay verbatim, all three buttons are disabled while compaction runs, and on hard failures the card shows host diagnostics instead of approving.

How to Install

install
npmdsh plugin --profile web add dsh-plan-compact-execute
Category
Tools & Capabilities
Platform
DSH Plugin
Author
spookywaste
Distribution
Plugin

dsh-plan-compact-execute Key Features

Adds Compact & Execute to approval cardCompacts pre-plan context into a summaryKeeps plan and approval text verbatimDisables buttons and shows diagnostics
Listed on dsh-plugin.org

dsh-plan-compact-execute Repo Summary

What Does It Do?

It is a DSH plugin for DeepSeek Harness that adds a third option, "Compact then Execute", to the plan-mode approval card in the Web client. It solves the problem of approving a plan when the surrounding context is too long and the usual compaction command cannot help, because approval happens inside a tool call while the agent is mid-turn. This DSH plugin compacts the history from before the plan was submitted into a summary checkpoint, then approves the plan so the model starts executing with the plan preserved verbatim.

Core Features

  • Expands the approval card action row from "Request Changes / Approve" to "Request Changes / Compact then Execute / Approve", with the first two behaving exactly like the official implementation.
  • Compacts the session history from before the plan was submitted into a summary, then answers the pending question with the question's own approval label, so plan mode exits right away.
  • Keeps the plan body, the approval text, and any unfinished tool batch verbatim; only the exploration history before the plan is replaced by a summary checkpoint shown as "compacted" in the conversation stream.
  • Disables all three buttons while compaction runs, and on hard failures such as an existing compaction in progress, surface changes during summarization, or commit and persistence failures, it does not approve the plan; the card shows host diagnostics and you can still click "Approve".
  • Exposes a minShadowedTokens setting, default 2000, so when the compactable region is priced below that token count the plugin approves directly and logs a host entry.

How to Use This Plugin?

Enter plan mode in the DSH Web client, wait for the model to submit a plan, and click "Compact then Execute" on the approval card: the plugin compacts the history before the plan, then approves it and exits plan mode automatically. To tune the trigger threshold, change minShadowedTokens in the plugin config (for example 4000) so compaction only runs when the context is long enough. Note that the host half is a loaded JS artifact and needs a gateway restart after changes, while the client bundle is watched by dsh-client-modules and hot-swaps when lib/client.js changes.

How to Troubleshoot This Plugin?

If the plan is not approved after clicking "Compact then Execute", a hard failure likely occurred during compaction: another compaction was already running, the surface changed during summarization, or the commit and persistence step failed. The card then shows host diagnostics; fix the issue as described in the official docs and retry, or simply click "Approve" to approve the plan normally. If the compactable region is priced below minShadowedTokens, the plugin skips compaction and approves directly while writing one entry to the host log, which is expected behavior rather than an error.

This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: spookywaste/dsh-plan-compact-execute. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.

Install, update, and uninstall this plugin in the Plugin Market of DeepSeek Harness's DSH Plugin Hub

DSH Plugin FAQ