Introduction

In DSH Web conversations, the context window is a limited resource. When the conversation history becomes lengthy, manually typing the /compact command to compress earlier messages can interrupt the workflow. dsh-compact-button is a client-side plugin maintained by shyuan-hub. It adds “Compress Context” and “New Session” buttons to the DSH Web context meter panel, reducing the operational hassle when the context is close to full.

Core Features

  1. One-click compression: Places a “Compress Context” button in the context meter panel. Clicking it submits the /compact command to the current session.
  2. Same channel as /compact: Compression results use exactly the same channel as manually typed commands, ensuring consistent semantics.
  3. Real-time status feedback: Button labels update according to submission status (ready, submitting, submitted, etc.) and automatically return to ready after 4 seconds.
  4. Automatic language switching: Switches between English and Chinese in real time according to the DSH language setting.
  5. New session: Clicking the “New Session” button starts a new session in the same workspace.
  6. Zero intrusion: The plugin does not render content or interfere with the rest of the platform.

Installation and Activation

Run the following command to install the plugin:

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

After installation is complete, restart dsh web to apply the changes.

Typical Usage

  1. Expand the context meter panel (the ring next to the input box).
  2. Click the “Compress Context” button to submit the /compact command to the current session.
  3. Click the “New Session” button to start a new session in the same workspace.

Applicable Scenarios and Notes

  • Applicable scenario: Suitable for developers who need to manage the context window frequently.
  • Precautions:
    • Depends on the conversation.context.actions sub-slot. If this slot does not exist, the buttons are not rendered.
    • A new session does not automatically inherit non-default presets.
    • The plugin runs with the permissions of the current dsh web process. Review the source code and license before installing.