dsh-session-view: Aggregate session load, cost, timing, and raw text into a panel

Introduction

When running long sessions in DSH, the most common questions are hidden in “what exactly happened this time”: why was this round slow, where were the tokens spent, why did the tool fail, which 429 was triggered, and is the context the model actually sees the same as what I thought?

Existing troubleshooting methods usually involve flipping through local session logs, manually counting tokens, and guessing at the timeline. Conclusions are hard to pin down to a specific timeline and are not easily exported for archiving. dsh-session-view merges load, cost, timing, and the original text into a single panel, allowing you to view them by partition without needing to switch back and forth between logs and tables.

Below is an introduction to this plugin.

What is it

dsh-session-view (package name @local/dsh-session-view) is a DSH client plugin, maintained by NAS1112, categorized as a client, with 0 stars displayed on the community directory page. It adds “Tools / Content” tabs above the session page, allowing you to view the load, cost, timing, and original text of a session together.

The plugin only reads local session logs (~/.dsh/sessions/...), does not initiate network requests, and does not report any data. Settings like price, density, and masking are stored in browser localStorage.

Core Features

Tools Page (Four Partitions)

  • Overview: Health check conclusion (one-sentence judgment), problem list, duplicate call detection, tool distribution, failure reasons.
  • Cost: Token structure and price by model, automatic sub-agent summary, manual supplements, unit price import/export, baseline configuration.
  • Timing: Timeline (zoomable, selectable), waterfall chart, round baseline (Tukey anomaly detection), duration distribution, round comparison.
  • Operations: Average/Peak TPM, Average/Peak RPM, First Token Latency P95, Rate limit events (click to see every 429).

Details: A searchable, sortable, paginated call table + rate limit table, supporting “Original Text” positioning and “Follow-up” backfill.

Content Page

System prompt / Prompt assembly / Context / User and Assistant messages, individually copyable and backfillable into the input box.

General

  • ⌘K command palette, compact/comfortable density toggle.
  • Export Markdown / TSV / Single-file HTML (HTML is searchable and sortable, supports masking).

Installation and Enablement

Prerequisites

Requires DSH Desktop or Web version, and already has a profile directory ~/.dsh/profiles/<profile-name>/ (commonly desktop).

Steps

  1. First place it in a fixed location, do not use a temporary directory, DSH will reference this path via link.
mkdir -p ~/dsh-plugins
# Method 1: git clone this repo
git clone https://github.com/NAS1112/dsh-session-view.git ~/dsh-plugins/dsh-session-view
# Method 2: Download zip and extract
unzip dsh-session-view-*.zip -d ~/dsh-plugins
# Result: ~/dsh-plugins/dsh-session-view/
  1. Register the plugin in the profile. Edit ~/.dsh/profiles/<profile-name>/package.json, adding two places:
{
  "dependencies": {
    "@local/dsh-session-view": "link:/Users/<you>/dsh-plugins/dsh-session-view"
  },
  "dsh": {
    "profile": {
      "bundles": [
        "...",
        "@local/dsh-session-view"
      ]
    }
  }
}

The path in dependencies must be an absolute path pointing to the extracted directory; add the package name to the bundles array so DSH mounts it at startup.

  1. Fully exit the application and reopen it. Refreshing the page is not enough; the bundle list is read at startup.

  2. Verification: Open any session, and the “Tools / Content” tabs should appear at the top of the page, with a version marker in the top right corner (e.g., 2026-11-04 19:48).

Self-Check (Optional)

cd ~/dsh-plugins/dsh-session-view
node smoke.cjs              # Expected: ok: rendered tools tab / content tab
node jump-check.cjs         # Expected: highlight, filter, and hints for all assertions pass

Both scripts use stub React to execute the component tree, requiring no browser or real data. jump-check.cjs requires a set of session logs to exist locally; otherwise, it will skip data-related assertions.

Uninstall

Delete the corresponding entries from the profile’s dependencies and bundles, delete the directory, and restart DSH.

Typical Usage

  • Why is this round so slow? → Go to the Timing page: the timeline is zoomable and selectable, the waterfall chart locates the slowest tool call, and the round baseline (Tukey anomaly detection) marks the unreasonable one.
  • Where were the tokens spent? → Go to the Cost page: split token structure and price by model, auto-summarize sub-agents, import unit price and compare with the configured baseline.
  • Why did the tool fail? → Overview page’s problem list, failure reasons, and duplicate call detection; Operations page’s rate limit events can be clicked to see details of every 429.
  • What did the model actually see? → Content page: system prompt, context, and every message restored one by one, copyable and backfillable into the input box to reproduce the issue.
  • Archive or share → Export Markdown / TSV / Single-file HTML (self-contained, searchable/sortable, supports masking).

Entry point: Open any session, and the “Tools / Content” tabs appear at the top of the page; ⌘K invokes the command palette.

File Description

File Purpose
package.json Plugin manifest: dsh.client declares client entry, dsh.bundle.patch points to bundle config
index.js Host-side entry (empty implementation, all rendering is on the client)
client.js All UI and data calculation, single file
cordis.patch.yml Bundle patch, injecting the session-view row into the host
locale/en.json, locale/zh.json Language packs
icon.svg Icon
smoke.cjs Smoke test: node smoke.cjs, verifies all four partitions can render
jump-check.cjs Jump regression test: verifies “Original Text” and “Details positioning” land in the correct places

Applicable Scenarios and Notes

Suitable for developers already using DSH who need to retrospectively review sessions: wanting to read cost structure, slow call locations, rate limit events, and real context from a session, rather than relying on manual log flipping.

Two points to note: first, the plugin runs with the permissions of the current DSH process and can read all session logs under that profile; check the source code and license before installing (package.json states MIT). Second, it only does read-only analysis, does not modify logs, and does not initiate network requests. The exported report is a self-contained HTML without external script links.

Conclusion

The value of dsh-session-view lies in gathering several key dimensions of a session into a single read-only panel, so troubleshooting no longer requires manually piecing together logs, tables, and timelines. Before installing, review the source code and license. After installation, run the self-check with smoke.cjs and jump-check.cjs.

Directory page: https://www.skillhub.cn/plugins/NAS1112/dsh-session-view
GitHub: https://github.com/NAS1112/dsh-session-view

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye