diff options
| author | t <t@tjp.lol> | 2026-08-18 14:18:14 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-08-18 14:20:28 -0600 |
| commit | cc69a2e431779528578211a5cb3385bb23e076bf (patch) | |
| tree | 8833171e25bb3dfb71fc4a2e0b8fe583782da764 /spec/test_toml_workflows.lua | |
| parent | 372ef8ff40991644ec2654c61328f31779f4ad21 (diff) | |
Persist and replay subagent progress across sessions
Record durable child-turn metadata, restore bounded progress cards during
startup replay, and keep settled cards attached to transcript entries. Add
workflow-local Lua profiles and expose discovered agents and workflows in the
session header.
Diffstat (limited to 'spec/test_toml_workflows.lua')
| -rw-r--r-- | spec/test_toml_workflows.lua | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/test_toml_workflows.lua b/spec/test_toml_workflows.lua index 8ae2cac..4755b8e 100644 --- a/spec/test_toml_workflows.lua +++ b/spec/test_toml_workflows.lua @@ -11,6 +11,7 @@ local fake = require("spec.fake_ext") local paths = require("subagents.paths") +local progress = require("subagents.progress") local toml_workflows = require("subagents.toml_workflows") local function has(text, needle) @@ -384,9 +385,25 @@ return { end) end }, - { "the tool runs a transient definition", function() + { "the tool runs a transient definition and presents each child prompt only when expanded", function() with_host(function(handle, profiles) handle.queue_for("alpha", { output = "transient output" }) + progress.reset() + local component + progress.claim({ + id = "workflow-call", + tool_name = "subagents.workflow", + collapsed = true, + set_component = function(_, value) + component = value + return { + invalidate = function() end, + alive = function() return true end, + set_pinned = function() end, + } + end, + }) + progress.bind({ tool_call_id = "workflow-call" }) local text = toml_workflows.handle({ prompt = "the input", steps = { { id = "only", agent = "alpha", prompt = "Do it." } }, @@ -394,11 +411,21 @@ return { has(text, "step: only") has(text, "transient output") has(handle.spawns[1].prompt, "Do it.\n\n## Workflow input\n\nthe input") + local compact = table.concat(component:render(100), "\n") + assert(not compact:find("Do it.", 1, true), compact) + assert(not compact:find("the input", 1, true), compact) + progress.collapse({ collapsed = false }) + local expanded = table.concat(component:render(100), "\n") + has(expanded, "prompt: Do it.") + has(expanded, "## Workflow input") + has(expanded, "the input") + assert(not expanded:find("system prompt:", 1, true), expanded) has(toml_workflows.handle({ prompt = "x", steps = { { id = "only", agent = "alpha", prompt = "p", needs = { "ghost" } } }, }, profiles), "unknown dependency 'ghost'") + progress.reset() end) end }, } |
