Answer the stability review's second round
This commit is contained in:
@@ -41,7 +41,7 @@ def delete_session(session: Session) -> Failure | None:
|
|||||||
return None
|
return None
|
||||||
stem = path.removesuffix(".jsonl")
|
stem = path.removesuffix(".jsonl")
|
||||||
# <session id>.jsonl, <session id>/subagents/, and from older versions <session id>.superseded-1789290815002/ and <session id>.orphaned-*.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):
|
for sibling in sorted(glob.glob(glob.escape(stem) + "*"), key=lambda sibling: sibling == path):
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(sibling) if os.path.isdir(sibling) else os.remove(sibling)
|
shutil.rmtree(sibling) if os.path.isdir(sibling) else os.remove(sibling)
|
||||||
|
|||||||
Reference in New Issue
Block a user