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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user