DeepSeek Harness Plugin

Minecraftbe/dsh-toolfold

Stars ★ 0 Category UI Enhancements Added 2026-08-15

Codex-style tool call folding, collapsing multiple tool calls into a single line.

Install

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:Minecraftbe/dsh-toolfold

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).

README

A DSH Web GUI plugin delivering a Codex-like folding experience: runs of consecutive tool calls and settled thinking fold into a single compact bar showing a one-line summary of the last call — click to expand/collapse. It replaces no built-in renderer, and uninstalling restores the UI completely.

Folding demo

Highlights

  • Runs of tool calls fold into one bar: consecutive tool calls (a run may include settled thinking between calls) collapse into a single bar showing the last call's one-line summary, labelled "已折叠 N 个工具调用 · 点击展开" (N folded calls · click to expand);
  • Thinking folds with the run: settled think blocks never split a run — hidden by default, or (with "保留思考" enabled) hidden while collapsed and re-inserted in their original order between the calls on expand. Nothing disappears;
  • In-progress thinking stays visible: streaming think blocks render as their own row until they complete, then fold into the group automatically;
  • Spring waterfall animations: cards cascade down on expand (spring overshoot) and rise with a synchronized height shrink on collapse — content below follows continuously, no end snap; disabled automatically under prefers-reduced-motion;
  • Bottom-pinned expand: expanding near the bottom pins the bar's viewport position, so the chat's auto-scroll never shoves it off the top of the screen;
  • Near-zero performance cost: no page-wide observer, zero work while content streams, and everything pauses when the tab is hidden — measured ≈0.03% of one core while idle (see Performance).

Expand / collapse animation

Installation

One-line GitHub install

dsh plugin --profile web add github:Minecraftbe/dsh-toolfold

Install from source

git clone https://github.com/Minecraftbe/dsh-toolfold.git
dsh plugin --profile web add ./dsh-toolfold

After installing, restart dsh and refresh the browser to activate (bundle layers are composed at boot). Verify the plugin reached the final config with:

dsh --profile web --dump-config

If an earlier version was mounted manually with a toolfold row in cordis.patch.yml, remove that row before switching to this channel to avoid double-mounting.

Uninstall

dsh plugin --profile web remove dsh-toolfold

After a restart the UI is completely restored.

Usage & Settings

Settings: Settings → Plugins → 工具折叠 (the card matches the built-in plugin cards and follows the light/dark theme).

Settings card

Setting Description
展开动画时长 (expand duration) Per-card duration of the expand/collapse waterfall, 0–1000ms, default 240ms; 0 = instant
保留思考 (keep thinking) On: settled thinking folds with the run and reappears in its original order between the calls on expand; Off: thinking is hidden outright
性能统计 (performance stats) Shows the plugin's own live cost in the card (cumulative counts and ms/s for observer callbacks / engine refreshes / merge passes / safety rescans / summary clones, plus the streaming batches ignored by the zero-cost short-circuit)

Interactions: click the bar to expand/collapse; Enter or Space works too.

Where settings live

  • Installed (bundle) mode: the DSH settings service persists them to ~/.dsh/settings.yaml (namespace toolfold) — the same document the product and other plugins use, host-side, so they survive browser/device changes. The card footer shows "设置保存在 DSH 主机配置". The file is editable directly:

    toolfold:
      durMs: 240        # expand animation duration, 0–2000ms
      keepThink: false  # fold settled thinking with the run
      stats: false      # performance meter
    
  • When no DSH settings service is detected (remote browsers and other setups without the DSH settings bridge): degrades to browser localStorage (key dsh-toolfold.settings.v1) and the card says "仅保存在本浏览器"; the legacy key dsh-codex-collapse.settings.v1 migrates automatically on first load.

Keep-thinking comparison

Performance

  • Measured on the live GUI (8s idle window): engine total ≈1.6–2.8ms (≈0.3ms/s, ≈0.03% of one core); a 5s CPU sample in the same window shows zero samples from the engine — the page's long tasks (141–686ms) come from page load, product rendering, and other plugins;
  • Zero work while streaming: text/think token mutations are short-circuited in O(1) and never trigger a recompute (≈0.1–0.4µs per node);
  • Hidden tab = literally zero: all observers and timers disconnect on hide and re-attach with a reconciliation pass on return;
  • Turn on "性能统计" to watch every cost item live inside the settings card.

Notes & Limitations

  • Folding works on the rendered DOM and depends on stable product markers; if the product markup changes, the worst case is that folding stops applying — the chat itself is never harmed;
  • In-progress thinking and AI text output separate runs (in-progress thinking folds into the group once it completes);
  • Expanded state is remembered per session flow + node key; reopening a session with the same keys restores it;
  • Settings are owned by the DSH host config (~/.dsh/settings.yaml); browser localStorage is only the fallback when the host bridge is unreachable (then each browser needs its own setup);
  • Requires MutationObserver and requestAnimationFrame; without them it degrades to "fold once on initial render".

This project was entirely completed by dsh + deepseek v4 flash(max).

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →