Skip to content

Commit f14f14a

Browse files
authored
Update test_tui.py
1 parent 42c080f commit f14f14a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/test_tui.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,6 +2315,19 @@ def test_find_session_by_title(self):
23152315
self.assertEqual(Tui._find_session_by_title("fix bugs"), dash)
23162316
self.assertIsNone(Tui._find_session_by_title("nothing here"))
23172317

2318+
def test_start_agent_clears_todos(self):
2319+
"""A new top-level run drops any todo list left over from a
2320+
previous run so a finished task's todos don't stay pinned into
2321+
the next task."""
2322+
tui, _ = make_tui()
2323+
self.assertTrue(tui.session.todos) # make_tui seeds a todo list
2324+
with (
2325+
mock.patch.object(tui, "_run_agent"),
2326+
mock.patch.object(tui, "_run_live", return_value=False),
2327+
):
2328+
tui._start_agent("next task")
2329+
self.assertEqual(tui.session.todos, [])
2330+
23182331

23192332
if __name__ == "__main__":
23202333
unittest.main()

0 commit comments

Comments
 (0)