In actual use of DeepSeek Harness (DSH), a single turn of conversation often generates intermediate nodes such as tool calls, intermediate assistant messages, and retry records. These nodes accumulate before the final reply, significantly increasing the length of the conversation and making it harder to read the final conclusion. Modifying DSH source code directly to change the UI logic is not flexible and is difficult to maintain. We need a solution that folds these process nodes into a summary without modifying DSH core code.
This article introduces @ycp424c/dsh-auto-fold-turn. It is a DSH Web external client plugin maintained by ycp424c under the MIT license. Its core function is: after the final reply has been generated, automatically collapse the tool calls, intermediate assistant messages, retries, and other process nodes that appear before the final reply in that turn into a one-line summary.
Core Features¶
- Automatic folding summary: Automatically collapses tool calls, intermediate assistant messages, retries, and other process nodes before the final reply in a turn into a summary.
- Layout position: The summary line is located after the user prompt and before the process nodes. By default, the summary line is placed at the top of the agent response for that turn.
- Interaction control: Users can expand or collapse it at any time.
- State persistence: Explicit expanded state is persisted to localStorage by
sessionId + turn, survives page refreshes, and remains until the user collapses it again. - Implementation approach: Does not modify or patch DSH source code. All behavior is implemented through DSH’s official Conversation Node extension interface and a thin DOM adapter layer.
- Independent control: Each Turn can be folded or unfolded independently; operations on one Turn do not affect other Turns.
Behavior and Strategies¶
- Default folding: All loaded Turns with a final reply are collapsed by default, including historical Turns (historical replace / prepend and real-time append follow the same rule).
- Preserved content: After collapsing, user messages, the summary line, the final reply, terminal-state prompts after the final reply (error / max-token, etc.), and DSH’s native turn-tail actions are preserved.
- Fail-open policy: The plugin uses a unified fail-open policy. When there is no closing assistant, the final assistant cannot be uniquely identified, snapshot targets and DOM lines cannot be fully mapped, localStorage is unavailable/corrupted/fails to write, or the plugin is unloaded, content is not hidden, ensuring the native chat content is fully restored.
Installation and Enabling¶
The plugin is managed through DSH’s plugin system. It can be installed via the community directory link.
https://www.skillhub.cn/plugins/ycp424c/dsh-auto-fold-turn
Typical Usage¶
When a user starts a conversation that includes tool calls in the DSH interface, after the conversation ends, tool calls, intermediate assistant messages, and other nodes before the final reply are automatically collapsed into a one-line summary (for example, ▶ Process · N items). Users can click this line to expand and view the detailed process.
Use Cases and Notes¶
The plugin is suitable for developers who need long-chain debugging or primarily want to check the final output.
- Permissions and dependencies: The plugin runs with the permissions of the current dsh process. Before installing, check the source code and license.
- API dependency: The three markers used by the plugin (
data-chat-anchor-key,data-chat-flow-kind,data-conversation-scroll) are currently used by DSH itself but are not regarded as a stable public API. - Uninstall restoration: After disabling or uninstalling the plugin, the native chat content is fully restored.
Conclusion¶
After following the steps above, you can obtain a clean conversation view in DSH, keeping only the final reply while collapsing process nodes into a summary. This plugin implements non-invasive folding through the Conversation Node extension interface and a DOM adapter layer.
- GitHub repository: https://github.com/ycp424c/dsh-auto-fold-turn
- Directory page: https://www.skillhub.cn/plugins/ycp424c/dsh-auto-fold-turn