From ab829fbcbbac3c50ece8e67953b024710d4b1bc6 Mon Sep 17 00:00:00 2001 From: t Date: Tue, 25 Aug 2026 15:18:34 -0600 Subject: Discourage active waiting for background workflows --- init.lua | 2 +- spec/test_init.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 2fd89d5..e4e5240 100644 --- a/init.lua +++ b/init.lua @@ -210,7 +210,7 @@ local w = subagents.workflows["workflow-1"] return w.status .. (w.result and ("\n" .. w.result) or "") ``` -Workflow fields are `id`, `status`, `result`, `error`, and `agents`; `workflow:cancel()` requests cancellation of every running agent. Agents are available by name or iteration and expose `name`, `status`, `output`, `error`, and `id`; `agent:cancel()` requests cancellation of that agent. Fields are read-only, and cancellation returns true only while the target is running. Workflow completion wakes you with its id; use another `subagents.lua` call to retrieve whichever outputs you need. +Workflow fields are `id`, `status`, `result`, `error`, and `agents`; `workflow:cancel()` requests cancellation of every running agent. Agents are available by name or iteration and expose `name`, `status`, `output`, `error`, and `id`; `agent:cancel()` requests cancellation of that agent. Fields are read-only, and cancellation returns true only while the target is running. Workflow completion wakes you with its id; use another `subagents.lua` call to retrieve whichever outputs you need. Do not actively wait or poll with `sleep`; continue other work or return control until the completion message arrives. ]=] local function install_guidance(ext) diff --git a/spec/test_init.lua b/spec/test_init.lua index bb42c57..e3b4d55 100644 --- a/spec/test_init.lua +++ b/spec/test_init.lua @@ -147,6 +147,7 @@ return { has(guidance, "subagents.workflows") has(guidance, "name=\"implement\"") has(guidance, "Review correctness") + has(guidance, "Do not actively wait or poll with `sleep`") end }, { "layered config sets max_concurrent with later layers winning", function() -- cgit v1.3