DSH branch conversation protection plug-in: deleting the parent topic will no longer take away the child conversations
Prevents DSH from deleting child sessions when deleting parent topics, and provides capabilities such as incremental backup, accidental deletion recovery, data inspection, orphan cleanup, and one-click safe deletion.
storehouse:https://github.com/bishopcao/dsh-session-guard(MIT license, README Chinese)
Capabilities at a glance
session protection
- As soon as a new branch is established, the parent-child relationship is automatically disconnected, and deleting the parent topic will no longer delete the child conversation.
- Historical branches that existed before installation will be automatically scanned and completed during startup.
- Child agent sessions are not moved (their parent-child relationship is a normal runtime structure)
Backup and recovery
- Automatic incremental backup of all sessions to
~/.dsh/session-guard-backup/ - Full volume for the first time, then only copied files that have changed
- Accidentally deleted sessions can be restored byte by byte
- Backup retention period is configurable (default 30 days, 0 = never clean)
- Only clean up the backup of "session no longer exists", live sessions will not be deleted due to expiration
Delete session
- session
⋯There is an additional "Delete Session" item in the menu - Process: Back up first → remove from the list → then physically delete. Deletion errors can be recovered.
- Supports cascading: delete subagents and fork descendants together
- Running sessions cannot be deleted to avoid losing the content being generated.
Data physical examination
- List the session files that cannot be read and attach the reasons: frame header damage, empty directory, ID mismatch, project directory cannot be opened, etc.
- Change "One less item is missing from the backup list" to "Can you explain why it is missing?"
Orphan child agent cleanup
- Subagents whose parent session no longer exists but still occupy disk will be listed separately.
- Supports one-click cleaning and automatic backup before cleaning
Sidebar icon area collapsed
- When too many icons occupy the workspace, you can only display the first N and scroll the rest.
- N optional 1–6 (default 4), the collapsed state and row number will be remembered
Tools for agents
dsh_session_lineage—— Read-only, view parent-child chains, risks and dangling referencesdsh_detach_sessions——Manual release, default preview, uploadconfirm: trueJust write
What problem to solve
When DSH forks a new branch from a conversation, the child conversation will internally remember a parentSession Refer back to the parent topic.
When the archive plug-in deletes a topic, it will delete these "descendants" together——rmSync Delete directly,If you don’t enter the recycle bin, you can’t recover it after deletion.。
There is no prompt during the deletion process, so "clearing archived topics" may also destroy the conversations that are still in use.
This plug-in blocks it from both ends: on the one hand, it prevents the father-son relationship from happening at all, and on the other hand, it keeps a backup copy.
How to use
You will see it after installation
- Sidebar shield icon —— Click to open the complete panel: automatic independent switch, unrecording, data physical examination, accidental deletion recovery, backup management, deletion
- plug-in card ——In the "Plugins" page
dsh-session-guard, the function is the same as above - Session header small logo ——Shows whether the current conversation has terminated the parent-child relationship
- session menu —— Any conversation
⋯There is one more "delete conversation"
Install
dsh plugin --profile desktop add dsh-session-guard
or write in ~/.dsh/profiles/<profile>/package.json:
{
"dependencies": { "dsh-session-guard": "1.0.7" },
"dsh": { "profile": { "bundles": ["dsh-session-guard"] } }
}
Restart DSH after installation.
Configuration(Three items have runtime switches, which can also be changed directly. cordis.patch.yml)
- insert:
- id: session-guard
name: dsh-session-guard
config:
autoDetachOnMount: true # 启动时解除历史分叉
backupOnMount: true # 启动时增量备份
backupRetentionDays: 30 # 备份保留天数,0 = 永不清理
boundary
- When deleting the parent topicThe parent topic will still be deleted, what the plug-in removes is "jointly"
- Only handles real conversations that are manually separated, without touching subagents
- Backups are copies, not version history (one copy per session, overwritten if changed)
There are no messages yet. please Log in or Register an account Start this discussion.