Answer principles round 1: 0 🔴, 3 🟡 (0 misread); return withdraw's failure as a warning, check every field read_ask reads, test loop-inbox's /talk end, move TALK to waiting.py

This commit is contained in:
2026-10-29 00:09:05 +01:00
parent ba8a0df807
commit 4d6926e790
6 changed files with 124 additions and 24 deletions
+9
View File
@@ -720,6 +720,15 @@ class Interrupts(unittest.TestCase):
self.assertEqual(self.put(fake, effects=effects), ("Use C.", f"\n{STAMP} Which one?\n{STAMP} Answered in loop-inbox: Use C. \n"))
self.assertEqual(list(self.paths.waiting.iterdir()), [])
def test_takes_the_answer_typed_on_its_terminal_where_loop_inbox_cannot_list_the_question(self):
self.paths.waiting.parent.mkdir(parents=True)
self.paths.waiting.write_text("")
answer, said = self.put(FakeEffects(inputs=["Use B."]))
self.assertEqual(answer, "Use B.")
self.assertIn(f"loop-inbox may still list this question: cannot remove {self.paths.waiting / f'{self.session.id}.json'}: Not a directory", said)
stop, _ = self.talk(states.Talk(self.ask(), waiting.OpenOnTerminal()), FakeEffects(on_terminal_claude=[0], git=[""]).effects())
self.assertEqual(stop, Stop(2, "the human is needed to answer the question above, but the interrupt ended with nothing typed"))
def talk(self, chosen, effects):
with contextlib.redirect_stderr(io.StringIO()) as said:
stop = interrupt.talk(chosen, self.session, self.paths, effects)