End a session with its sibling folder, share the part renderer, and split claude-instances
This commit is contained in:
@@ -82,6 +82,24 @@ class Archive(unittest.TestCase):
|
||||
self.assertIn("said", open(copy).read())
|
||||
|
||||
|
||||
class Said(unittest.TestCase):
|
||||
def test_renders_text_and_tool_calls_and_nothing_else(self):
|
||||
self.assertEqual(loop.said({"type": "text", "text": "hi"}), "hi")
|
||||
self.assertEqual(loop.said({"type": "text", "text": " \n"}), "")
|
||||
self.assertEqual(loop.said({"type": "tool_use", "name": "Bash", "input": {"command": "x" * 500}}, 20), '[tool Bash] {"command": "xxxxxxx')
|
||||
self.assertEqual(loop.said("not a part"), "")
|
||||
|
||||
|
||||
class EndSession(unittest.TestCase):
|
||||
def test_removes_the_transcript_and_its_sibling_folder(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
transcript = os.path.join(root, "abc.jsonl")
|
||||
open(transcript, "w").write("{}\n")
|
||||
os.makedirs(os.path.join(root, "abc", "subagents"))
|
||||
loop.end_session(transcript)
|
||||
self.assertEqual(os.listdir(root), [])
|
||||
|
||||
|
||||
class Grounded(unittest.TestCase):
|
||||
def test_an_interrupt_must_quote_the_transcript(self):
|
||||
self.assertTrue(loop.grounded({"ask": False, "evidence": ""}, "anything"))
|
||||
|
||||
Reference in New Issue
Block a user