Skip to main content

How to use dsh-plugin-session-delete

Add delete session capability to DSH Web interface: trash can button at top of session, delete item in sidebar "..." menu, Agent tool workbench_session_delete, deleting session logs, projection cache and workspace accounting.

This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.

This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.

Quick start

dsh-plugin-session-delete

— source: plugin_wiki.wiki_content

Install & verify

dsh plugin --profile web add github:lsz-asd/dsh-plugin-session-delete

Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.

— source: plugins.install

Key points

  • 侧栏会话行 "..." 菜单注入"删除会话"项
  • RiskConfirmation 风险确认:勾选"我已了解后果"后确认可用
  • 删除链路:会话目录 + 投影缓存 + 工作区记账(经活动 storageDomain,内存/磁盘一致)
  • workbench_session_delete 工具:agent 可直接删除会话
  • 添加更多针对会话的操作工具和选项

— source: plugin_wiki.readme_en (fallback readme_raw)

FAQ

Must restart web after installation for changes to take effect?

Yes. The Host side is injected via cordis bundle line, and you need to restart dsh web to load new routes and tools; the same applies to client modules.

Can I delete a running session?

Yes, but the server will first call agent.cancel({kind:'user'}) and wait for agent.whenIdle (up to 15 seconds), confirming the stop before executing the deletion; the client dialog will use ⚠ to warn users that this operation will interrupt ongoing tasks.

How was the incomplete deletion / returning to 'ungrouped' issue fixed?

Since v0.3.1, both original uuid and session-<uuid> id forms are cleaned up; disk logs are deleted first and confirmed successful before releasing workspace accounting; active sessions are flushed before deletion to avoid log directory recreation during dispose phase.

Why are the sidebar "..." menu items not native menu items?

The session-row "..." menu (rename/fork/archive) in rc.6 is hardcoded in ui-workspace with no extension slots, so this plugin uses MutationObserver to monitor the DOM and dynamically inject the "Delete Session" item into the menu; the label color matches the official error color.

Can the "Delete Session" button work in the desktop client?

Yes. client.js is injected by the web platform (dsh.client.platform: web) and loaded by the desktop shell; the session top button dispatches by sessionId, the DOM-injected sidebar item matches by title, sharing the same delete dialog.

How to uninstall?

Run dsh plugin --profile web remove github:lsz-asd/dsh-plugin-session-delete and restart the profile; since the cordis bundle line id is fixed, reinstallation/uninstallation both go through the same line without manual cleanup.

What data is affected when deleting a session?

Delete the log directory under ~/.dsh/sessions///, clear the projection cache domain (the sessions table rows in storageDomain session_projcache), and remove from the workspaces.sessionIds array and global.archivedSessionIds array in the workspace domain; the client list refreshes immediately after deletion.

Is session ID validation strict?

Strict. The Host side only accepts IDs matching the (session-)?<uuid> regex, otherwise returns 400 invalid session id; sidebar clicks perform exact/fork-suffix-removed/contains-three-segment matching against the client list store, falling back to /__chameleon/session/list on miss.

— source: plugin_wiki.faq_json

Compatibility

  • DSH: ^0.1.0-rc.6
  • Node: >=20

— source: plugin_wiki.compatibility_json

Pitfalls

Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.

— source: general rule