From 2f27e66f5073a8649087aaea01ccb742e33fd47f Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 29 Oct 2026 18:37:23 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=203=20=F0=9F=9F=A1=20(0=20misread);=20test=20that?= =?UTF-8?q?=20loop-inbox=20removes=20a=20killed=20loop's=20ask=20as=20it?= =?UTF-8?q?=20looks=20and=20that=20a=20loop=20leaves=20the=20ask=20of=20an?= =?UTF-8?q?other=20that=20holds=20the=20session's=20lock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/loop_claude/test_loop_claude.py | 9 +++++++++ bin/loop_inbox/test_loop_inbox.py | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index 7abed6e3..1b59bd43 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -744,6 +744,15 @@ class Interrupts(unittest.TestCase): stop, _ = self.put(FakeEffects(inputs=["/talk"], on_terminal_claude=[0], git=[""])) self.assertEqual(stop, Stop(2, "the human is needed to answer the question above, but the interrupt ended with nothing typed")) + def test_leaves_the_question_another_loop_lists_for_the_session_where_that_loop_holds_its_lock(self): + theirs = self.ask(question="Theirs?") + self.enterContext(session_lock.locked(self.paths.waiting, theirs.session)) + waiting.publish(self.paths.waiting, theirs) + answer, said = self.put(FakeEffects(inputs=["Use B."])) + self.assertEqual(answer, "Use B.") + self.assertIn(f"loop-inbox cannot show this question: another process holds {session_lock.lock_file(self.paths.waiting, theirs.session)}", said) + self.assertEqual(self.asked(), [theirs]) + def test_makes_way_for_the_claude_loop_inbox_opens_and_goes_on_once_the_human_typed_there(self): def claude_ran(_): # loop-inbox opens claude only once the loop lists it as open there. diff --git a/bin/loop_inbox/test_loop_inbox.py b/bin/loop_inbox/test_loop_inbox.py index d1f7cb02..997d044b 100644 --- a/bin/loop_inbox/test_loop_inbox.py +++ b/bin/loop_inbox/test_loop_inbox.py @@ -336,6 +336,15 @@ class Waiting(unittest.TestCase): waiting.drop_ended(folder) self.assertEqual(asks_and_answers(folder), []) + def test_loop_inbox_removes_a_killed_loops_ask_and_answer_as_it_looks(self): + with tempfile.TemporaryDirectory() as home: + paths = paths_from(pathlib.Path(home)) + ask = asked("s1", "/a") + waiting.publish(paths.waiting, ask) + waiting.send(paths.waiting, ask, Typed("Use A.")) + main.run(Window("q"), contextlib.nullcontext, paths, system_effects()) + self.assertEqual(asks_and_answers(paths.waiting), []) + def test_removes_only_the_asks_and_answers_whose_loop_has_ended(self): with tempfile.TemporaryDirectory() as temp: folder = pathlib.Path(temp)