DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

qianshe /

dsh-assistant-optimization

Verified

DSH plugin: fold mis-rendered thinking/reasoning content into collapsible blocks and render mermaid diagrams inline.

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@84ccb69e

dsh-assistant-optimization

A DSH plugin that folds mis-rendered thinking/reasoning content into collapsible blocks and renders mermaid diagrams inline.

中文文档

The Problem

Some LLM providers (especially those using OpenAI-compatible APIs without a dedicated reasoning_content channel) dump the model's chain-of-thought into the regular text output, like this:

The user wants to know about X, I should explain Y first...
</thinking>
Here is the answer to your question...

DSH renders the entire thing as normal message text, making it hard to separate reasoning from the actual answer.

Features

  1. Thinking tag split — Splits text at configurable markers (default: ``). Content before a marker becomes a collapsible "Think" block via DSH's native ReasoningRow. Everything after renders as normal text.
  2. Mermaid diagrams — ```mermaid code blocks render as interactive SVG diagrams with zoom, pan, and touch support.
  3. Settings page — Manage split markers under Settings → General.

All original rendering (Markdown, tool calls, images, tables) is handled by the official DSH renderer — the plugin only does text splitting.

Installation

Via dsh plugin (recommended)

dsh plugin --profile web add github:qianshe/dsh-assistant-optimization

Restart your web profile:

dsh web

Open http://127.0.0.1:3080 — the plugin is active automatically.

From source

git clone https://github.com/qianshe/dsh-assistant-optimization.git
cd dsh-assistant-optimization
dsh plugin --profile web add .

Update

dsh plugin --profile web update dsh-assistant-optimization

Uninstall

dsh plugin --profile web remove dsh-assistant-optimization

Restart the profile after removing.

Usage

After installation, the plugin works automatically — no extra steps needed.

  • Reasoning fold — When a model outputs `` (or any marker you configure), the reasoning text before it is collapsed into a "Think" disclosure. Click to expand/collapse.
  • Mermaid — Any ```mermaid code block in the conversation renders as an SVG diagram. Use the toolbar buttons (zoom in/out/reset), scroll wheel to zoom, or mouse/touch drag to pan.
  • Custom markers — Go to Settings → General → Thinking Tag Markers to add or remove split markers (different models may use different tags).

Configuration

Setting Default Description
Markers ["](lib/client.js) Strings that split reasoning from body text. Text before a marker becomes a collapsible block. Multiple markers supported.

How It Works

Slot priority wrapping

The plugin registers a component at conversation.chat.node slot key assistant-step with priority: -1, shadowing the official renderer at priority: 0. At render time, the wrapper:

  1. Finds the official renderer via slots.entries()
  2. Checks if the message's data.blocks contain any text blocks
  3. Splits text blocks at configured markers into alternating reasoning + text blocks
  4. Calls the official renderer with the modified blocks

The official renderer handles everything — ReasoningRow folding, Markdown rendering, tool-call cards, image galleries — the plugin only does string splitting.

File structure

├── cordis.patch.yml   # composition layer: plugin row insert
├── lib/
│   ├── index.js       # Host entry (no-op)
│   └── client.js      # Browser plugin (__ModuleLoader__.load wrapper)
├── package.json       # dsh.bundle + dsh.client metadata
├── src/               # Dynamic plugin source (for development)
│   ├── host.js
│   └── client.js
└── docs/
    └── design.md      # Design document

Requirements

  • DSH (DeepSeek Harness) with the web profile
  • Internet access (only for mermaid.js CDN loading when diagrams are present)

License

MIT

—/ 5

No ratings yet

Verified DSH bundle

Commit 84ccb69e7285

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout