feat(sessions): add trash-icon delete for live and persisted sessions (T-47) - #19
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
T-47: no way to delete a session from the sidebar listing without opening it first. The client also never called the existing
DELETE /sessions/:idendpoint, and that endpoint itself only handled live handles — a persisted-only session (idle-reaped, or from a previous server process) would 404, and even a successful live delete only detached the in-memory handle without removing the.jsonlfile from disk.Scope
AgentBridge.deleteSession(id)(new): disposes any live handle, then resolves the session's file path (live handle'ssessionFile, or a match inlistAll()) and actually deletes it + its artifact dir via the SDK'sSessionManager.dropSession(). Idempotent on ENOENT.DELETE /sessions/:id: now calls the new bridge method, 404s only on a genuinely unknown id, and broadcastssessions_changedon success so other open tabs see the row disappear live.disposeSessionrenamed todeleteSession, now also splices the id out of the persistedsessionslist (previously only cleared the live cache).Sidebar.tsx: hover-revealed trash icon on each session row (live and persisted), with a confirm prompt before deleting.Verification
SessionManagerin a temp dir, plus newDELETE /sessions/:idroute coverage for unknown-id 404, success + broadcast).