[Bug/Feature] sessionPersistence: no delete/forget API — externally removed session files leave stale in-memory index entries that get resurrected on disk #4411
Replies: 1 comment
|
Root-cause confirmation from an independent implementation (+ one deeper layer: detached drain resurrection) @123123liang - I hit this exact gap independently while building durable chat deletion (delete active/archived chats: persisted log, subagent descendants, workspace/projection references) on top of
What a complete surface needs, mapping to your "Expected" section:
Verified working end-to-end against a source-booted server: archived and active chats deleted, stored logs physically gone from disk (absence confirmed via One scoping note for anyone considering the plugin route: this cannot be a plugin today - it requires new methods on the abstract persistence class and each backend, compile-time wire schema extensions, and workspace-UI changes. It has to land in core. I keep this as a maintained feature branch on a fork (rebased periodically); happy to share the diff privately if the team ever wants to evaluate it. |
Uh oh!
There was an error while loading. Please reload this page.
[Bug/Feature] sessionPersistence: no delete/forget API — externally removed session files leave stale in-memory index entries that get resurrected on disk
Environment
Symptom
When session files are removed outside the host's session API (there is no delete surface today), the running server's in-memory session index keeps the entry:
session "<id>" already exists in this backend— even though the session directory was deleted andverify_sessionreports the session no longer exists.session_projcache.json/workspace.jsonfrom its in-memory state, resurrecting entries that were manually cleaned on disk. Disk-level cleanup is therefore ineffective while the server is running.Impact
Expected
forget/deleteAPI (even if the underlying file is not removed, at least evict the in-memory + persisted index entry), orcreateIfAbsent/ the session registry tolerating stale index entries whose backing file is missing (auto-evict or auto-replace), orRepro
~/.dsh/sessions/<workspace>/<sessionId>/directory and remove itssession_projcache.json/workspace.jsonentries while the server is running.already exists in this backend.Context
Discovered while recovering a lost import in the
dsh-chat-importplugin flow (see companion reports). The plugin'sretract_importexplicitly documents "DSH 无 delete 面" (no delete surface), which is the root gap this issue asks to close.All reactions