From c062f8793f22bc492f3dfff0c098d1e0b5be2910 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 17:27:58 +0100 Subject: [PATCH] Kill the two surviving mutants of the headless claude calls --- bin/agent_cycle/test_stuck_workers.py | 7 ++++++- bin/do_epic/test_issue_scores.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/agent_cycle/test_stuck_workers.py b/bin/agent_cycle/test_stuck_workers.py index 4d47325f..8c4f503e 100644 --- a/bin/agent_cycle/test_stuck_workers.py +++ b/bin/agent_cycle/test_stuck_workers.py @@ -36,7 +36,11 @@ class StuckWorkers(unittest.TestCase): if each_check: streamed.shells = lambda: [each_check.pop(0)] fake = FakeEffects(streams=[streamed], claude=replies) - effects = dataclasses.replace(fake.effects(), now=lambda: clock[0]) + self.claude_folders = [] + def claude(args, cwd, stdin): + self.claude_folders.append(cwd) + return fake.effects().claude(args, cwd, stdin) + effects = dataclasses.replace(fake.effects(), now=lambda: clock[0], claude=claude) with tempfile.TemporaryDirectory() as folder, contextlib.redirect_stdout(io.StringIO()) as said, contextlib.redirect_stderr(io.StringIO()) as failed: archive = archive or pathlib.Path(folder, "transcripts", "project") worker.run_worker("/r", [], {}, archive, RUNG, effects) @@ -48,6 +52,7 @@ class StuckWorkers(unittest.TestCase): [(args, prompt)] = fake.made("claude") self.assertEqual(args[args.index("--model") + 1 :][:3], ["claude-opus-5-5", "--effort", "medium"]) self.assertEqual(args[args.index("--tools") + 1 :][:2], ["", "--strict-mcp-config"]) + self.assertEqual(self.claude_folders, ["/r"]) self.assertEqual(json.loads(args[args.index("--json-schema") + 1])["properties"]["verdict"]["enum"], ["working", "waiting on a person", "stuck"]) self.assertTrue(prompt.endswith("\n\nShell 7: bin/run-tests\nIts processes, as pid, state, CPU and command line:\n8 S 2.0 s python3 -m pytest\n9 S 0.0 s sh -c trap '' INT; sleep 999\nThe end of its output:\ncollected 40 items")) line = "stuck check: a headless claude judged the worker stuck, naming process 8 (python3 -m pytest): pytest waits on a shell that ignores SIGINT" + sign(1600, 1600) diff --git a/bin/do_epic/test_issue_scores.py b/bin/do_epic/test_issue_scores.py index 51e289ac..58f4a714 100644 --- a/bin/do_epic/test_issue_scores.py +++ b/bin/do_epic/test_issue_scores.py @@ -58,7 +58,7 @@ class TheCall(unittest.TestCase): def test_names_the_scoring_where_claude_fails(self) -> None: failed = self.ask(Claude("", 1)) assert isinstance(failed, Failure), failed - self.assertIn("the scoring", failed.reason) + self.assertEqual(failed.reason, "the scoring exited 1") def test_puts_the_rule_the_goals_the_language_and_the_item_in_the_prompt(self) -> None: text = prompt(ISSUE, "L is the chance of a defect.", "An item moves only these: `epic 1`.", "Swedish")