In the DeepSeek Harness Web interface, session compaction usually requires manually entering a command. dsh-plugin-compact-button adds a button to the left of the model selector, directly invoking the deployment’s built-in /compact command to turn compaction into a single click.

Plugin Details

Name: dsh-plugin-compact-button
Author: liutian11451-png
License: MIT

Core Functionality

The plugin provides a compaction gesture in the Web UI. It submits a bare /compact line through the Session command channel, ensuring that all related records (persistence attempts, compaction locks, summary routing, and rendered flow nodes) are owned by /compact.

  1. Blank Session Handling: When the session is empty, nothing is rendered because there is no history to compact.
  2. Agent Running State: While the agent is running, the button is grayed out and unclickable, retaining its default label. Manual compaction requires an idle agent.
  3. Compaction Status Feedback: The “Compacting…” label is displayed during compaction until the compaction turn ends.
  4. Rejection Reason Display: Inline rejection reasons are displayed above the Composer line. Transport failures display the host message; a missing /compact command is reported as a missing capability.
  5. Bundle Declaration: The plugin declares dsh.bundle.

Installation and Enablement

Install it using the official plugin management command. Because the plugin declares dsh.bundle, dsh plugin automatically registers its patch layer in the configuration file.

dsh plugin --profile web add dsh-plugin-compact-button

Replace web with the configuration profile name you actually use. After initial installation, restart dsh web and reload the page; the build payload is composed at startup, so reloading the page alone is not sufficient on first install.

Development and Testing

If you need to develop or test from source:

pnpm install
pnpm build       # 生成 lib/index.js 和 lib/client.js
pnpm typecheck
node smoke.mjs   # 在模拟 shell 上测试加载器契约

Limitations and Notes

  1. Prerequisites: The deployment must mount the compaction capability — that is, dsh-command-compact plus a compaction backend. If the command is missing, the button still renders and rejects clicks due to a missing capability.
  2. Runtime Constraints:
    • Web Profile Only: The plugin only declares platform: web, with no terminal UI equivalent.
    • Idle Agents Only: Disabled while the agent is running, consistent with the compactNow requirement.
    • No Region Selection: The control always submits a no-parameter form, so it compacts the full useful scope of the backend.
  3. Behavioral Details:
    • Reservation ≠ Completion: The command RPC resolves when the host reserves the line, so the “Compacting…” label covers the window from the gesture to the end of the compaction turn. Compactions started by automatic policies or other turns do not change the label; the control only turns gray while that turn is running.
    • The Busy Label Is Bounded, Not Exact: If a reserved attempt never produces an observable run, it is released after an 8-second grace period. Compactions started afterward may make the control appear idle prematurely.
  4. Source Review: This code was generated by an AI agent (deepseek-flash) on 2026-09-12. Review the source before using it, especially before allowing its prepare script to run on your machine.

Conclusion

This plugin provides a standardized compaction entry point for the DSH Web interface, eliminating manual command input. For more details and source code, please visit the GitHub repository.