From d5f5af48b9566c922969a0dd59699d00fec4e566 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 2 Oct 2026 07:43:08 +0200 Subject: [PATCH] Answer the prose review's first round --- bin/loop_claude/claude_code/session.py | 4 ++-- bin/test_loop_claude.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/loop_claude/claude_code/session.py b/bin/loop_claude/claude_code/session.py index b39343fd..228cc678 100644 --- a/bin/loop_claude/claude_code/session.py +++ b/bin/loop_claude/claude_code/session.py @@ -41,10 +41,10 @@ def delete_session(session: Session) -> Failure | None: return None stem = path.removesuffix(".jsonl") # .jsonl, /subagents/, and from older versions .superseded-1789290815002/ and .orphaned-*.jsonl - # The transcript goes last, so a failed delete leaves a session that session_open still sees. + # 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. 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) except OSError as failure: - return Failure(f"could not delete {sibling}: {failure.strerror or failure}; delete every file and folder matching {stem}* and rerun loop-claude, or the next chunk resumes the finished chunk's session") + return Failure(f"could not delete {sibling}: {failure.strerror or failure}; delete every file and folder matching {stem}*, then rerun loop-claude; until then the next chunk would resume the finished chunk's session") return None diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index 87b14a8d..bfb547b1 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -186,7 +186,7 @@ class Cycles(unittest.TestCase): self.addCleanup(folder.chmod, 0o700) fake = FakeEffects(streams=[Worker(self.paths.claude_code_transcripts.parent)], claude=[judged("finished")]) stop = steps.run_cycle(self.cycle(fake)) - self.assertEqual(stop, Stop(1, f"could not delete {folder}: Permission denied; delete every file and folder matching {folder}* and rerun loop-claude, or the next chunk resumes the finished chunk's session")) + self.assertEqual(stop, Stop(1, f"could not delete {folder}: Permission denied; delete every file and folder matching {folder}*, then rerun loop-claude; until then the next chunk would resume the finished chunk's session")) self.assertTrue(session.session_open(self.session)) self.assertEqual(self.archived_verdicts(), ["Task: Do it.\n\nVerdict: finished\n"])