Answer the stability review's second round

This commit is contained in:
2026-10-02 07:44:18 +02:00
parent d5f5af48b9
commit ce9eaf6114
+1 -1
View File
@@ -41,7 +41,7 @@ def delete_session(session: Session) -> Failure | None:
return None
stem = path.removesuffix(".jsonl")
# <session id>.jsonl, <session id>/subagents/, and from older versions <session id>.superseded-1789290815002/ and <session id>.orphaned-*.jsonl
# The transcript goes last: a failed delete then leaves the session whole, never a new session with this id beside the old one's files.
# The transcript goes last: a failed delete leaves a session session_open still sees, never a new session with this id beside the old one's files.
for sibling in sorted(glob.glob(glob.escape(stem) + "*"), key=lambda sibling: sibling == path):
try:
shutil.rmtree(sibling) if os.path.isdir(sibling) else os.remove(sibling)