Repository navigation
feat(sidebar): delete all sessions of a project from its menu - #1182
Merged
Merged
Conversation
A project group's ⋯ menu ends with "Delete all sessions… · N": the menu turns into a question (Cancel focused, so Enter deletes nothing), then deletes every family of the project that has a file, pinned and archived ones included, keeping the ones that run or wait for input. A toast says how many went; an open session among them falls back to a fresh composer. The row delete's server code moves to lib/session-delete.ts as deleteSessions(ids), shared by DELETE /api/sessions/[id] and the new POST /api/sessions/delete: one catalogue listing and one read of each folder per request instead of per session, subagents with their parent, survivors re-pointed at their nearest ancestor that stays, and with keepRunning a session that started running since the question is kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-sessions-74046a # Conflicts: # AGENTS.md # lib/sidebar-actions.ts
…-sessions-74046a # Conflicts: # AGENTS.md # components/SessionSidebar.test.mjs # lib/rpc-manager.test.mjs
Main now keeps only tests that run code; the route tests above cover the bulk delete, and runtime-route.test.mjs the row's single delete. Co-Authored-By: Claude Opus 5.5 <[email protected]>
agegr
added a commit
that referenced
this pull request
Oct 11, 2026
#1182 added lib/session-delete.ts to the sessions.md entry in AGENTS.md, the same line this branch rewords for the Prism languages; keep both. Co-Authored-By: Claude Opus 5.5 <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 6, 2026
…1182) * feat(sidebar): delete all sessions of a project from its menu A project group's ⋯ menu ends with "Delete all sessions… · N": the menu turns into a question (Cancel focused, so Enter deletes nothing), then deletes every family of the project that has a file, pinned and archived ones included, keeping the ones that run or wait for input. A toast says how many went; an open session among them falls back to a fresh composer. The row delete's server code moves to lib/session-delete.ts as deleteSessions(ids), shared by DELETE /api/sessions/[id] and the new POST /api/sessions/delete: one catalogue listing and one read of each folder per request instead of per session, subagents with their parent, survivors re-pointed at their nearest ancestor that stays, and with keepRunning a session that started running since the question is kept. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(sessions): drop the delete route's source-text assertion Main now keeps only tests that run code; the route tests above cover the bulk delete, and runtime-route.test.mjs the row's single delete. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
…1182) * feat(sidebar): delete all sessions of a project from its menu A project group's ⋯ menu ends with "Delete all sessions… · N": the menu turns into a question (Cancel focused, so Enter deletes nothing), then deletes every family of the project that has a file, pinned and archived ones included, keeping the ones that run or wait for input. A toast says how many went; an open session among them falls back to a fresh composer. The row delete's server code moves to lib/session-delete.ts as deleteSessions(ids), shared by DELETE /api/sessions/[id] and the new POST /api/sessions/delete: one catalogue listing and one read of each folder per request instead of per session, subagents with their parent, survivors re-pointed at their nearest ancestor that stays, and with keepRunning a session that started running since the question is kept. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(sessions): drop the delete route's source-text assertion Main now keeps only tests that run code; the route tests above cover the bulk delete, and runtime-route.test.mjs the row's single delete. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Adds Delete all sessions… · N to a project group's ⋯ menu.
What it does
onSessionDeleted, so an open session among them falls back to a fresh composer in its cwd.Server
app/api/sessions/[id]/route.tsintolib/session-delete.tsasdeleteSessions(ids, { keepRunning? }).DELETE /api/sessions/[id]now calls it with one id and behaves as before.POST /api/sessions/delete { ids }:isApiRequestAllowed, JSON content type).{ deleted, missing, running }. A session that started running after the user confirmed is kept and reported, not stopped.Tests
app/api/sessions/delete-route.test.mjscovers:lib/session-tree.test.mjs:familiesToDelete()(pinned, archived, worktree, fork and subagent families are in; running, awaiting and transient ones are out).lib/sidebar-actions.test.mjs:deleteProjectSessions()sends parts in order and sums the answers; a refused part or a network error stops the run and reports what was already deleted.components/SessionSidebar.test.mjs: menu item, question body, focus and the delete flow.lib/rpc-manager.test.mjs: the graceful-shutdown source check now readslib/session-delete.ts.npm test(2941 pass) all pass after merging current main.PI_CODING_AGENT_DIR, two projects, one pinned, one archived, one with a subagent):Docs:
docs/agents/sessions.md(sidebar section) and theAGENTS.mdfile map.🤖 Generated with Claude Code