From 6ffe432dba5f0c66b3467fdb53ed64cdcc7793b8 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 30 Oct 2026 21:32:21 +0100 Subject: [PATCH] Expect CLAUDE_CODE_SANDBOXED in the terminal claude's environment --- bin/loop_claude/test_loop_claude.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index 43a69fec..f7656094 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -305,7 +305,7 @@ class Cycles(unittest.TestCase): cycle = dataclasses.replace(self.cycle(fake), project=Rung("claude-opus-5-5", "medium"), route=Route(Rung("claude-haiku-5-5", "max"), 163, 1, 5)) with contextlib.redirect_stderr(io.StringIO()): self.assertEqual(run.run_cycle(cycle).verdict, Finished("working")) - self.assertEqual(fake.terminal_environments, fake.worker_environments) + self.assertEqual(fake.terminal_environments, [{**environment, "CLAUDE_CODE_SANDBOXED": "1"} for environment in fake.worker_environments]) self.assertEqual(fake.terminal_environments[0]["LOOP_CLAUDE_WORKER_RUNG"], "claude-haiku-5-5 at max effort") def test_an_unfinished_chunks_transcript_is_archived_and_the_next_cycle_resumes_its_session_with_the_judges_evidence(self): @@ -824,7 +824,7 @@ class Interrupts(unittest.TestCase): def test_hands_the_claude_that_takes_the_terminal_the_workers_environment(self): fake = FakeEffects(inputs=["/talk"], on_terminal_claude=[0], git=[""]) self.put(fake) - self.assertEqual(fake.terminal_environments, [{"LOOP_CLAUDE_WORKER_RUNG": "m at high effort"}]) + self.assertEqual(fake.terminal_environments, [{"LOOP_CLAUDE_WORKER_RUNG": "m at high effort", "CLAUDE_CODE_SANDBOXED": "1"}]) class RoutingCheck(unittest.TestCase): @@ -890,7 +890,7 @@ class RoutingCheck(unittest.TestCase): ((args),) = fake.made("claude_on_terminal") self.assertEqual(args[:6], ["--model", "m", "--effort", "high", "--permission-mode", "bypassPermissions"]) self.assertIn(f"change nothing until they answer:\n- {call}", args[6]) - self.assertEqual(fake.terminal_environments, [{}]) + self.assertEqual(fake.terminal_environments, [{"CLAUDE_CODE_SANDBOXED": "1"}]) (self.root / "routing-figures.md").write_text("Measured x, at cycle 0 across") self.assertEqual(self.check(FakeEffects(git=[UNREAD]))[0], None) self.assertNotIn(call, self.check(FakeEffects())[1])