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¶
- One-click compression: Places a “Compress Context” button in the context meter panel. Clicking it submits the
/compactcommand to the current session. - Same channel as
/compact: Compression results use exactly the same channel as manually typed commands, ensuring consistent semantics. - Real-time status feedback: Button labels update according to submission status (ready, submitting, submitted, etc.) and automatically return to ready after 4 seconds.
- Automatic language switching: Switches between English and Chinese in real time according to the DSH language setting.
- New session: Clicking the “New Session” button starts a new session in the same workspace.
- 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¶
- Expand the context meter panel (the ring next to the input box).
- Click the “Compress Context” button to submit the
/compactcommand to the current session. - 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.actionssub-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 webprocess. Review the source code and license before installing.
- Depends on the