From 7c5b1e71bcb271ca368650ea34feeb7735cf924f Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Fri, 20 Nov 2026 17:37:58 -0500 Subject: [PATCH] test(idle-reap): name the turn's tool output when a kernel link is missing A full gate once found no kernel_links row right after the first turn of test_idle_sweep_keeps_a_loaded_kernel_holding_an_unsaved_value, and the test died unpacking None. The link is written before the kernel boots and is kept while the kernel lives, so a missing row means the cell never reached a kernel or the kernel ended. The daemon reports both to the model, not to its log, so the failure carried no evidence of which. kernel_of now fails with the turn's tool outputs, so a recurrence shows the cause instead of a TypeError. --- e2e/idle_reap_test.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/e2e/idle_reap_test.py b/e2e/idle_reap_test.py index 05ba22e33..8d67fb427 100644 --- a/e2e/idle_reap_test.py +++ b/e2e/idle_reap_test.py @@ -170,11 +170,21 @@ class IdleReapTests(unittest.TestCase): ) def kernel_of(self, session): + """The pid of the kernel the session's last turn ran its cell in. The + link is written before the kernel boots and is kept while the kernel + lives, so a missing one means the cell never reached a kernel or the + kernel ended; the turn's tool output says which.""" with sqlite3.connect(self.app.home / "albedo.sqlite") as database: - (kernel,) = database.execute( + row = database.execute( "SELECT pid FROM kernel_links WHERE session=?", (session,) ).fetchone() - return kernel + outputs = [ + item["output"] + for item in self.provider.requests[-1]["request"]["input"] + if "output" in item + ] + self.assertIsNotNone(row, f"no kernel link after the turn: {outputs}") + return row[0] def first_save(self, session): """The state file once a release has written it, with its identity.""" -- knotmirror 0.0.1