summaryrefslogtreecommitdiff
path: root/spec/test_progress_replay.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/test_progress_replay.lua')
-rw-r--r--spec/test_progress_replay.lua23
1 files changed, 15 insertions, 8 deletions
diff --git a/spec/test_progress_replay.lua b/spec/test_progress_replay.lua
index cf2925e..ffe7e5c 100644
--- a/spec/test_progress_replay.lua
+++ b/spec/test_progress_replay.lua
@@ -3,6 +3,8 @@ local progress = require("subagents.progress")
local run = require("subagents.run")
local luatool = require("subagents.luatool")
local toml_workflows = require("subagents.toml_workflows")
+local workflow = require("subagents.workflow")
+local uv = require("luv")
local function plain(lines)
return table.concat(lines, "\n"):gsub("\27%[[%d;]*m", "")
@@ -269,24 +271,29 @@ return {
"settled status is retained for durable presentation")
handle.queue_for("alpha", { output = "fixed done" })
- toml_workflows.handle({
- prompt = "fixed",
+ toml_workflows.run(assert(toml_workflows.validate({
+ name = "fixed",
steps = { { id = "step", agent = "alpha", prompt = "run fixed" } },
- }, profiles)
+ }, "fixed")), "fixed", profiles)
assert(handle.runs[2].metadata.subagents.tool_call_id == "outer-run",
"fixed workflow child keeps the same outer owner")
assert(handle.runs[2].metadata.subagents.sequence == 2,
"fixed workflow child follows spawn order")
handle.queue_for("inline", { output = "inline done" })
- local source = [[return subagents.workflow(function(ctx, input)
- return ctx:agent({ agent = "inline", prompt = input }):await()
+ local source = [[return subagents.workflow(function(ctx)
+ local result = ctx:agent({ name = "inline-work", agent = "inline", prompt = "dynamic" }):await()
+ return result.output
end)]]
- luatool.handle({
- prompt = "dynamic",
+ local workflow_id = luatool.handle({
source = source,
agents = { { name = "inline", system_prompt = "INLINE" } },
- }, profiles)
+ }, profiles, { tool_call_id = "outer-run" })
+ for _ = 1, 100 do
+ uv.run("nowait")
+ if workflow.workflows[workflow_id].status ~= "running" then break end
+ end
+ assert(workflow.workflows[workflow_id].status == "completed")
local child = handle.spawns[3]
local manifest = child.system_messages[2].metadata.subagents
assert(manifest.inline == true, "inline workflow manifest is explicitly marked")