Pin a reason per incomplete verdict, the rerun hint off a terminal, and which claude could not start

This commit is contained in:
2026-09-28 16:48:46 +02:00
parent cd9c0fe4a6
commit 7b1ee20c7c
2 changed files with 13 additions and 13 deletions
+6 -5
View File
@@ -315,7 +315,8 @@ class Cycles(unittest.TestCase):
self.assertEqual(run.roles(), ["worker", "judge", "judge", "judge"])
self.assertEqual(run.sleeps, [60, 60])
self.assertIn("retrying the judge in a minute: judge down", run.stderr)
self.assertEqual(run.stderr.strip().splitlines()[-1], "the judge failed three times running: the judge returned no verdict")
self.assertIn("retrying the judge in a minute: the judge returned no verdict", run.stderr)
self.assertEqual(run.stderr.strip().splitlines()[-1], "the judge failed three times running: the judge's verdict has no evidence of type string")
def test_retries_the_judge_alone_when_its_verdict_quotes_nothing_in_the_transcript(self):
checkout = Checkout(self)
@@ -375,13 +376,13 @@ class Interrupt(unittest.TestCase):
steps = [worker(say="Shall I use A or B?"), judge(interrupt=True, evidence="Shall I use A or B?", question="A or B?")]
run = checkout.run(steps)
self.assertEqual((run.code, run.roles()), (2, ["worker", "judge"]))
self.assertEqual(run.stderr.strip().splitlines()[-2:], ["A or B?", "the human is needed to answer the question above, but stdin or stdout is not a terminal"])
self.assertEqual(run.stderr.strip().splitlines()[-2:], ["A or B?", "the human is needed to answer the question above, but stdin or stdout is not a terminal; rerun loop-claude on a terminal"])
self.assertTrue(checkout.archived())
session = argument(run.calls[0], "--session-id")
run = checkout.run(steps, terminal_input="", stdout_on_terminal=False)
self.assertEqual((run.code, run.roles()), (2, ["worker", "judge"]))
self.assertEqual(argument(run.calls[0], "--resume"), session)
self.assertEqual(run.stderr.strip().splitlines()[-1], "the human is needed to answer the question above, but stdin or stdout is not a terminal")
self.assertEqual(run.stderr.strip().splitlines()[-1], "the human is needed to answer the question above, but stdin or stdout is not a terminal; rerun loop-claude on a terminal")
def test_hands_the_terminal_over_and_exits_2_when_nothing_is_typed(self):
checkout = Checkout(self)
@@ -412,7 +413,7 @@ class Interrupt(unittest.TestCase):
run = checkout.run([worker(say="A or B?"), judge(interrupt=True, evidence="A or B?", question="A or B?", vanish=True)], terminal_input="")
self.assertEqual((run.code, run.roles()), (1, ["worker", "judge"]))
self.assertEqual(run.stderr.strip().splitlines()[-1], "could not start claude: No such file or directory")
self.assertEqual(run.stderr.strip().splitlines()[-1], "could not start claude for the interrupt: No such file or directory")
@unittest.skipIf(os.geteuid() == 0, "root reads an unreadable file")
def test_exits_1_when_the_transcript_cannot_be_read_after_the_interrupt(self):
@@ -435,7 +436,7 @@ class Models(unittest.TestCase):
self.catalog(checkout)
run = checkout.run([worker()])
self.assertEqual((run.code, run.calls), (2, []))
self.assertEqual(run.stderr.strip(), f'the human is needed to pick proj\'s model, or merge {{"proj": "<model>"}} into {checkout.models_file()}, but stdin or stdout is not a terminal')
self.assertEqual(run.stderr.strip(), f'the human is needed to pick proj\'s model, or merge {{"proj": "<model>"}} into {checkout.models_file()}, but stdin or stdout is not a terminal; rerun loop-claude on a terminal')
run = checkout.run([worker()], terminal_input="\x04")
self.assertEqual((run.code, run.calls), (2, []))