Archive every cycle's transcript and its session folder, however the cycle ends

This commit is contained in:
2026-10-02 16:00:14 +02:00
parent 9fb811c10a
commit 990963d586
8 changed files with 98 additions and 36 deletions
+5 -3
View File
@@ -344,9 +344,10 @@ class Cycles(unittest.TestCase):
self.assertNotIn("landed-it", run.calls[5]["stdin"])
self.assertEqual([path.name for path in checkout.transcripts()[0].parent.iterdir()], [checkout.transcripts()[0].name])
self.assertIn("=== cycle 3 ===", run.stdout)
[(copy, verdict)] = checkout.archived().items()
self.assertIn('"text": "landed-it"', copy)
self.assertEqual(verdict, f"Task: {TASK}\n\nVerdict: finished\n")
copies = {verdict.removeprefix(f"Task: {TASK}\n\n"): copy for copy, verdict in checkout.archived().items()}
self.assertEqual(sorted(copies), ["Stopped: Ctrl-C\n", "Verdict: finished\n", "Verdict: unfinished\n"])
self.assertIn('"text": "landed-it"', copies["Verdict: finished\n"])
self.assertIn('"text": "next chunk"', copies["Stopped: Ctrl-C\n"])
def test_exits_1_when_the_transcript_cannot_be_archived_and_resumes_on_the_next_run(self):
checkout = Checkout(self)
@@ -427,6 +428,7 @@ class Cycles(unittest.TestCase):
checkout = Checkout(self)
run = checkout.run([worker(unreadable=True)])
self.assertEqual((run.code, run.roles()), (1, ["worker"]))
self.assertRegex(run.stderr.strip().splitlines()[-2], r"^could not archive the transcript: .*\.jsonl: Permission denied$")
self.assertRegex(run.stderr.strip().splitlines()[-1], r"^could not read the transcript .*\.jsonl: Permission denied$")
def test_retries_a_worker_claude_cannot_start(self):