From 94e3fd8358bbdb5d6ed81aed475fab7fc73e2097 Mon Sep 17 00:00:00 2001 From: t Date: Tue, 18 Aug 2026 16:37:31 -0600 Subject: Fix workflow progress pin lifecycle --- spec/test_progress.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'spec/test_progress.lua') diff --git a/spec/test_progress.lua b/spec/test_progress.lua index 06509bf..5788998 100644 --- a/spec/test_progress.lua +++ b/spec/test_progress.lua @@ -20,6 +20,32 @@ local function plain(lines) end return { + { "startup replay stays in transcript order while live calls pin", function() + progress.reset() + progress.begin_replay() + local pins = {} + local function claim(id) + progress.claim({ + id = id, + tool_name = "subagents.workflow", + set_component = function() + return { + alive = function() return true end, + invalidate = function() end, + set_pinned = function(_, value) pins[#pins + 1] = value end, + } + end, + }) + end + claim("historical") + assert(#pins == 0, "replayed workflows must never pin") + progress.begin_live_turn() + claim("live") + assert(pins[1] == true, "a live workflow pins while it runs") + progress.reset() + assert(pins[2] == false, "reset releases the live workflow") + end }, + { "concurrent boards pin independently until their matching result", function() progress.reset() local pins = { a = {}, b = {} } -- cgit v1.3