active-worktree.ts 的三个进程级缓存只存路径、从不校验存在性: - pathTopCache(path → git 顶层)与 linkedWorktreeCache(top → 是否 linked worktree)永不过期; - activeWorktreeRootCache 虽有 15s TTL,但每次过期重扫时,候选路径仍会从上面两个缓存里拿回同一个 已删除的顶层目录,TTL 形同虚设。 结果是:侧栏跟随某个 linked worktree 之后,如果该 worktree 被外部删除(git worktree remove,或直接 在编辑器里删目录),侧栏根目录会永久钉在已删除的路径上 —— 文件树报「文件夹不存在」、git 面板报 「不是 git 仓库」,主仓库明明还健在,却只能重启 DSH 进程才能恢复(#960)。 改动(每次缓存命中多一次 stat(),相比它要避免的 ~7ms git 进程开销可以忽略;不新增任何 git 探测): - 新增 directoryPresence():**三态**判断,只有 ENOENT / ENOTDIR 才算「已消失」;EACCES / EPERM / EBUSY / EIO / EMFILE(被占用的句柄、杀软扫描、卡住的网络路径)一律按「无法判定」处理 —— 把这类 瞬时错误当成「已消失」会因为一次抖动就把侧栏改到仓库顶层,比它要修的那个陈旧答案更糟; - topOfActivePath():命中缓存且缓存的是路径时校验它,已消失才失效;失效后的**重新探测结果(负答案) deliberately 不写回缓存** —— pathTopCache 没有 TTL,一个由「消失」产生的负答案会把会话永久钉在 仓库顶层,连「worktree 删掉后又建回来」都再也跟不上了; - activeWorktreeRootOf():命中 TTL 缓存时同样校验 root(root === base 时跳过)。 测试(tests/active-worktree.spec.ts,共 11 例): - 原有 #960 用例:跟随 worktree → 删掉 → 同一会话回落到仓库(TTL 层)+ 新会话不被内层缓存污染; - 复核补的两例:① 目录还在、但 stat 连续报 EPERM/EBUSY/EACCES/EIO(整趟 ask 都失败,模拟被占用的 句柄/杀软/卡死的网络路径)必须继续跟随 worktree,不许改根;② 删掉后**原地重建**的 worktree 必须被 重新跟随(用新会话验证,因为旧会话按文档语义要等 15s TTL 过期)。 两例都按「先破坏实现再跑」验证过:把三态退化成「任何错误=消失」→ ①红;把失效产生的负答案写回缓存 → ②红。 变异实测:还原 src/active-worktree.ts → #960 用例红在 Received "…\\worktree"(已删除目录); 三态退化 → 瞬时错误用例红;负答案回写 → 重建用例红。 验证(本机 Windows / Node 22): - pnpm exec vitest run tests/active-worktree.spec.ts → 11/11;pnpm typecheck / pnpm lint → 通过 - pnpm test(全量)对照干净 dev:失败集合为子集,无新增失败(详见 PR 描述;两条既有失败在各树上 单独复跑时只剩 plugin-meta —— 那是 Windows tar 输出 CRLF 导致的确定性失败,不是超时) 未做:真机侧栏复现(本机没有装该插件的 DSH profile)。
dsh-better-sidebar
ctx.betterSidebar service open to every plugin✨ Features
Also: 📂 the sidebar_open tool lets the model open the sidebar itself · ⚡ ~325KB core at startup, heavy chunks load on demand · 🌏 i18n follows DSH · 📱 narrow screens switch to a full-width drawer
🌿 Git Graph (read-only commit graph)
Switch to Git Graph at the top of the Git panel for commit nodes, forks and merge edges across local branches, remote-tracking branches and HEAD. The branch selector only filters history — it never checks out or fetches; each commit is one line (lane edges + ref pills + subject), hover shows the author and short hash, and selecting one opens its full message and diff in the bottom pane. History loads in pages; reference changes during pagination prompt a refresh; reads are bounded (200 commits per page, offset 10,000, 1,000 branches) and report an explicit error past a limit. This first version shows no tags and offers no history-changing actions.
🚀 Installation
dsh plugin --profile web add dsh-better-sidebar@latest
Then hard-refresh the browser (Cmd/Ctrl+Shift+R). Requires DSH 0.2.0-rc.2+.
Pick the plugin version for your DSH version
| Your DSH version | Install command |
|---|---|
| 0.2.0-rc.2+ (incl. later stable) | dsh plugin --profile web add dsh-better-sidebar@latest |
| 0.1.7-rc.1 ~ 0.1.7 stable | dsh plugin --profile web add dsh-better-sidebar@0.22.1 |
| 0.1.7-alpha.x | No compatible release — upgrade DSH to rc.1 first |
| 0.1.6 and earlier (incl. the 0.1.5 line) | dsh plugin --profile web add dsh-better-sidebar@0.19.1 |
Always pin exact versions for older releases (latest moves forward with each new stable). Replace web with your own profile name.
Other ways to install
Let DSH install it for you — paste this prompt into any DSH session:
Install the dsh-better-sidebar plugin (a sidebar workbench for DSH):
1. Run dsh plugin --profile web add dsh-better-sidebar@latest (latest = current stable)
2. Remind me to hard-refresh the browser (Cmd/Ctrl+Shift+R) afterwards
If something fails, check the FAQ table in https://github.com/omdsh-dev/DSH-better-sidebar README first.
One-line script — clone this repo and run bash scripts/install.sh (macOS / Linux / Windows Git Bash; install.ps1 for native Windows). It handles installation + bundle registration.
Updating: just re-run the install command, then hard-refresh the browser.
FAQ
| Symptom | Cause & fix |
|---|---|
Ignored build scripts error |
pnpm 11 blocked a transitive dependency's build script. Run pnpm approve-builds in the profile directory (~/.dsh/profiles/web) — this plugin itself has no build-script dependencies. |
minimum release age / version younger than 24h |
The release is less than 24 hours old. Wait 24h or re-run (pnpm auto-adds minimumReleaseAgeExclude). |
| "Profile directory not found" | Run dsh web once to initialize ~/.dsh/profiles/web. |
| Two sidebars on the page | Double mounting. Remove the legacy manual mount line (- insert: ... better-sidebar ...) from ~/.dsh/profiles/web/cordis.patch.yml; aggregate packages mounting this package under a different id are auto-yielded, no action needed. |
| Settings values gone after upgrade | Since DSH 0.1.7, preferences live on this plugin's mount row in the profile (default entry id better-sidebar). The plugin migrates your old settings.yaml values once on first start and never overwrites newer values. |
| Terminal unavailable | Terminals are provided by DSH itself (this plugin ships no PTY) — see DSH docs; "host provides no terminal capability" in the bottom terminal means this deployment has no terminal controller mounted. |
dsh: command not found |
Install DSH first; or use npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar@latest. |
🆕 Recent Updates
v0.27.0 - full release history at Releases · CHANGELOG
- Git page rebuilt: Source Control groups, a read-only commit graph with branch filtering, and a shared Commit details / Content / Diff pane
- Accurate change tracking: separate staged/unstaged counts, nested-repository discovery, session-relative paths, PTC file operations and long polling
- Selection stays in place: fixed the integration regression that displaced selected files and drew stray borders; added real-host layout coverage
- Side Chat: new child sessions seed from the latest summarizing compaction instead of copying the full parent log
v0.26.1 — full release history at Releases · CHANGELOG
- ⚡ Fixed the steady-state cost behind "fine on 0.24, then it got slow" (community reports: the sidebar turns laggy after being open a long time, DSH turns laggy after many turns, a restart clears it for a while; an artifact-level A/B puts the line at v0.25.0): both 500 ms timers are now visibility-gated (the host right-panel state is one shared module-level poller; the blank-session fallback only runs while it actually renders), the per-tab 5 s session-root poll became one per session and only while visible, the file-tree watch and side-chat push stop when parked,
keepMountedkeeps its semantics while every cache/registry is now bounded, and the host cwd resolver gained in-flight dedupe with a 3 s → 15 s TTL - 📊 Measured in the real mount lane (4 visited tabs, 15 s idle window): live 500 ms timers 3 → 1, live 5 s timers 5 → 0,
session.cwdrequests 15 → 0, hit tests 1,620 → 0, forced layouts 5,190 → 30
🔌 Plugin Ecosystem
ctx.betterSidebar offers two extension points to every plugin — registerTab / registerFileViewer; the built-in 6 tabs + 4 viewers use the very same API. The GitHub topic dsh-better-sidebar already lists 30+ ecosystem plugins; the full integration guide is at docs/external-plugin-guide.md.
import type {} from 'dsh-better-sidebar' // triggers the ctx.betterSidebar type merge
export const inject = ['betterSidebar']
export function apply(ctx: Context) {
ctx.effect(() => ctx.betterSidebar.registerTab({
id: 'my-plugin:db', title: 'Database', component: ({ scope }) => <DbView sessionId={scope.sessionId} />,
}))
}
Ecosystem catalog (28 tab plugins · 4 viewer plugins · 4 enhancements)
📑 Tab plugins (sidebar pages)
| Plugin | ⭐ | Description |
|---|---|---|
| ChenRuoT/dsh-sidebar-qa | Select-to-ask side page: Codex-style side questions / Claude Code /btw |
|
| fuhefei/dsh-sentinel | Condition-driven wake-up system: file / command / HTTP / process / webhook watchers that wake an agent; dock + sidebar branch + global dashboard | |
| Fisfzy/ego-browser | Agent browser: i18n-aware local browser tab (auto-registers a sidebar page when better-sidebar is present, falls back to a floating observer) | |
| jiuge2467/dsh-studio | Full-stack workbench: multi-source MCP visual debugging hub, visual thinking engine | |
| Iwctwbh/dsh-flowglass | Flowglass: realtime session flow visualization (messages / tool groups / subagent branches) | |
| FeatherHunter/dsh-mattpocock-skills-deck | Gamified mattpocock/skills task system: fog-of-war map, task bar progression | |
| GULI-lab/DSH-element-source | Click any UI element to jump to its Vue / React / Svelte / Angular source and feed it into the session | |
| Lzh3070/dsh-file-review-tab | File review page: line-level red/green diff + undo + deep links into chat lines | |
| yq04/dsh-git-remotes | Git remotes page: branches / upstreams / ahead-behind, fetch with prune, ff-only pull, confirmed push | |
| ztyhehe/dsh-better-sidebar-svn | SVN source-control page: status / diff / log / commit / update / revert / conflict resolution, symmetric to the built-in Git panel | |
| Melody-max114/dsh-excel-panel | Excel editing page: xlsx preview / edit, live formula evaluation, merged cells, save back to the original file | |
| v587d/dsh-anysearch-refs | AnySearch result reference cards: query, source digest, keyword highlights | |
| Lukeknow0/dsh-markdown-link-preview | Markdown artifact link preview: click same-origin .md outputs in chat to read them in the sidebar |
|
| mlosun/dsh-docs-panel | Global docs panel: portable Markdown notes readable from any workspace | |
| tylina/dsh-tylina | Typst document tool: WYSIWYG typesetting for papers, reports, exams, resumes, charts, posters, sheet music, and PPTX-exported slides | |
| lnyuqian/dsh-skill-sidebar | Skills panel: scans local skill directories, short action phrases + one-click copy + pinning | |
| g-yixuan/dsh-sidenote | Codex-style side chat + selection-anchored annotations (lightweight consumer plugin) | |
| OMSociety/dsh-ssh-tunnel | Multi-host SSH tunnels + SSH manager page | |
| OMSociety/dsh-git-forge | GitHub / Gitea accounts, project authorization and push policies | |
| YesSanSan/dsh-conversation-outline | Conversation outline page: turn-structured view, one-click jump, LLM one-line titles | |
| Wulabalabo/dsh-sidebar-Explorer-Plus | File manager page: upload / move / delete / rename / new folder (write operations) | |
| yq04/dsh-turn-review | Turn review: review agent changes turn by turn | |
| Ghz114514/dsh-refpics | Pinterest-style reference-image search: masonry flow, sidebar board, download & Eagle favorites | |
| yzlin499/dsh-yzlin499-easy-plugins | Handy utility bundle (friendly to bare-bones DSH) | |
| dong-victor/dsh-better-sidebar-starter | Run-configuration page: IDEA-style Run/Debug configs — one-click start, history, WebSocket live logs, parallel instances | |
| baosfeng/my-dsh-plugins | Personal plugin collection (dsh-file-activity): sidebar file-activity page — read / create / modify history and stats |
|
| Hoemr/dsh-better-overleaf | Overleaf tab: CDP browser login, project switching, local git mirror with two-way sync | |
| Andor-Z/dsh-turn-outline | Turn-trace page: folds the session by user turns, click any step to jump back to its chat position; zero LLM, read-only |
🖼️ Viewer plugins (file viewers)
| Plugin | ⭐ | Description |
|---|---|---|
| HuanLinOTO/dsh-plugin-better-sidebar-plugin-office | Office trio preview (.docx / .xlsx / .pptx), shipped as a separate slim bundle | |
| HuanLinOTO/dsh-plugin-better-sidebar-plugin-audio | Audio preview: zoomable waveform player + realtime spectrum, HTTP Range streaming route, scrubbable at any size | |
| zemul/dsh-video-preview | Inline video preview: .mp4 / .webm / .mov / .mkv / .avi with HTTP Range seeking | |
| dong-victor/dsh-better-sidebar-jupyter | Runnable .ipynb notebook view: lazy Python kernel, streaming output, save-back |
🧰 Enhancements & tools
| Plugin | ⭐ | Description |
|---|---|---|
| eg-bole/dsh-better-sidebar-icons | VSCode-style file / folder icon theme (vscode-icons port, pure DOM overlay, zero intrusion) | |
| dong-victor/dsh-better-sidebar-terminal-plus | Terminal enhancements: bundled Nerd Font icons, fixed xterm icon rendering, stable terminal cwd | |
| Max-Null/dsh-sidebar-preview-select | Preview selection boost: select text in the sidebar preview → floating "send to session" | |
| Hoemr/dsh-quicklook | QuickLook-style Space preview: press Space on the active file tab for full-size image / PDF / text |
📣 List your plugin: tag your repo with the
dsh-better-sidebartopic to appear on the topic page; then PR aPluginEntryintosrc/client/plugins-tabs.ts/plugins-viewers.tsto join the in-app recommended catalog.
⌨️ Keyboard Shortcuts
| Action | Keys |
|---|---|
| Save editor | Ctrl/Cmd + S |
| Find / replace in file | Ctrl/Cmd + F |
| Find next / previous | Ctrl/Cmd + G / Shift + Ctrl/Cmd + G |
| Select next occurrence | Ctrl/Cmd + D |
| Git commit | Ctrl + Enter |
| Close tab | Middle-click |
| Split / merge panes | Drag a tab to a pane edge / center |
| Reference a file in the input box | Hover a row → @file button |
🔐 Security & ⚠️ Known Limitations
- Routes sit behind a Host-header trust fence (same as
/api);fs.writeis atomic; git is only invoked via CLI and never sets identity - ⚠️ Since v0.23.0 the fs routes do no workspace-containment check: they can read/write any path the host user can reach (OS permissions only) — callers must not treat these routes as fenced
- HTML previews render in an opaque-origin sandboxed iframe; the sandbox can be disabled per feature in settings (off by default, with warnings)
- No git push/pull/fetch; the file tree only watches expanded directories; Markdown preview renders the saved file
- Read-only formats (spreadsheets / PDF / images / Office) are rendered by DSH's own document preview and follow the host version; the browser view only exists in the desktop profile
- Unsaved drafts are confirmed before closing a tab / deleting a file / refreshing; saving after external modification is rejected, never silently overwritten
- On mobile (<768px) there is no bottom panel — its tabs merge into the right sidebar's full-width drawer
🛠️ Development & Build
pnpm install # @deepseek-ai/* devDependencies are published, resolves directly
pnpm typecheck && pnpm lint && pnpm build && pnpm test
make check # aggregate gate (matches CI)
make mount # real-mount smoke: build + pack → pnpm test:mount
Architecture: a single npm package with host/client halves — host (src/index.ts): /sidebar/api/* JSON API, media / HTML preview / upload routes and two WebSockets; client (src/client/index.tsx): native right-sidebar tabs + bottom workbench; state persisted per session in localStorage. Repository rules: AGENTS.md.
Windows / Linux / macOS supported (macOS verified daily, the rest covered by unit tests and Windows CI); no native dependencies — building needs only Node ≥ 20 + pnpm ≥ 10.
💬 Community
QQ group: 577011007
🤝 Contributing
- Code changes go through PRs: develop on a
feat/*/fix/*branch →gh pr create; runpnpm typecheck && pnpm build && pnpm test(ormake check) before submitting - List an ecosystem plugin: tag your repo with
dsh-better-sidebar+ PR an entry intosrc/client/plugins-tabs.ts/plugins-viewers.ts - Repository rules:
AGENTS.md
👥 Contributors
🔗 Friends
- dsh-tianshu-tui: interactive terminal UI plugin for DeepSeek Harness with TDD and evidence-gate workflows
- dsh-TUI: Claude Code-style fullscreen terminal plugin — pixel-whale header, streaming thoughts, context progress bar + TPS gauge
- dshfind plugin store: third-party plugin market — public repos under the
dsh-plugintopic, synced daily - DeepSeek Harness Desktop Tauri: Tauri desktop build — 5MB installer, zero setup, plugins preinstalled
- DeepSeek Harness Desktop: a modern desktop app — start and manage local Harness services without configuring Node.js; website


