From 603db32a41a8ee7d6f43333250b06d950653eab2 Mon Sep 17 00:00:00 2001 From: dev_agent Date: Mon, 5 Oct 2026 10:30:09 -0400 Subject: [PATCH] Assert the late-save row is ok to prove the post-save timeout path The row-saved-late test only checked that one ai_runs row existed, so it would also pass if the work itself had timed out before the save. It now requires the row to be ok with no error, which holds only when the work ended in time and the save alone ran past the deadline. Co-Authored-By: Claude Opus 5.5 --- internal/ai/harness/guard_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/ai/harness/guard_test.go b/internal/ai/harness/guard_test.go index f46d0a2..e292526 100644 --- a/internal/ai/harness/guard_test.go +++ b/internal/ai/harness/guard_test.go @@ -316,8 +316,11 @@ func TestRunTimeout(t *testing.T) { t.Fatalf("out = %+v, want no output", out) } assertCalls(t, &f, 1) - if rows := runRows(t, cfg.Store); len(rows) != 1 { - t.Fatalf("rows = %+v, want one row", rows) + // An ok row with no error proves the work ended in time and only + // the save ran past the deadline. + rows := runRows(t, cfg.Store) + if len(rows) != 1 || rows[0].Status != string(StatusOK) || rows[0].Error.Valid { + t.Fatalf("rows = %+v, want one ok row with no error", rows) } }) t.Run("waiting for a slot", func(t *testing.T) {