Answer stability round 1: 0 🔴, 2 🟡 (0 misread); test the failed removal, run the new tests under the guard, and reword the prose round's finding

This commit is contained in:
2026-11-26 01:09:58 +01:00
parent 61f901a2c9
commit 05a195a09e
3 changed files with 22 additions and 9 deletions
+2 -2
View File
@@ -34,14 +34,14 @@ def session_open(session: Session) -> bool:
def discard_empty_transcript(session: Session) -> Failure | None:
"""Removes a 0-byte transcript, which a run that died early leaves: claude refuses `--session-id` for an id whose file exists, and cannot `--resume` it."""
"""Removes the 0-byte transcript a failed run can leave: claude refuses `--session-id` for an id whose file stands, and cannot `--resume` it."""
path = transcript_file(session)
if path is None or os.path.getsize(path) > 0:
return None
try:
os.remove(path)
except OSError as failure:
return Failure(f"could not remove the empty transcript {path}: {failure.strerror or failure}; remove it, then run it again")
return Failure(f"could not remove the empty transcript {path}: {failure.strerror or failure}; claude refuses to start the session while that file stands")
return None