diff options
Diffstat (limited to 'e2e/run.lua')
| -rw-r--r-- | e2e/run.lua | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/e2e/run.lua b/e2e/run.lua index c240813..56deda6 100644 --- a/e2e/run.lua +++ b/e2e/run.lua @@ -409,6 +409,14 @@ local function meta(needle) return (needle:gsub('"', '\\"')) end +local function json_string(text) + return '"' .. tostring(text) + :gsub('\\', '\\\\') + :gsub('"', '\\"') + :gsub('\r', '\\r') + :gsub('\n', '\\n') .. '"' +end + local function jsonl_ids(dir) local ids = {} for _, name in ipairs(list_dir(dir)) do @@ -630,6 +638,8 @@ scenario("resume", function() check_contains("the resumed child kept its id", second, "id: " .. child_id) local text = read_file(children .. "/" .. child_id .. ".jsonl") or "" + check_contains("the resumed child records its owning outer tool call", text, + meta('"tool_call_id"')) local turns = 0 for _, line in ipairs(lines_of(text)) do if line:find(meta('"subagents"'), 1, true) and line:find(meta('"model":'), 1, true) then @@ -705,7 +715,29 @@ scenario("sandbox-fanout", function() #jsonl_ids(assert(child_dir(install, primary_id))), 2) end) --- 5. The catalog tool, in all four shapes, against a provider whose reasoning +-- 5. An inline profile in the dynamic workflow gets a durable marker and +-- body, so restart replay can show the requested system prompt without +-- exposing discovered profile prompts. +scenario("inline-replay-manifest", function() + local install = make_install("inline-replay-manifest") + local source = "return subagents.workflow(function(ctx, input) return ctx:agent({ agent = 'inline', prompt = 'say INLINE-CHILD' }):await() end)" + local script = string.format( + 'tool subagents.lua {"prompt":"INLINE-INPUT","source":%s,"agents":[{"name":"inline","system_prompt":"INLINE-SYSTEM"}]}', + json_string(source)) + local out = turn(install, script) + check_contains("the inline workflow child completed", out, "INLINE-CHILD") + + local dir = assert(session_dir(install)) + local primary_id = jsonl_ids(dir)[1] + local children = assert(child_dir(install, primary_id)) + local ids = jsonl_ids(children) + check_equal("one inline workflow child persisted", #ids, 1) + local text = read_file(children .. "/" .. ids[1] .. ".jsonl") or "" + check_contains("the inline manifest is marked", text, meta('"inline":true')) + check_contains("the inline system prompt remains durable", text, "INLINE-SYSTEM") +end) + +-- 6. The catalog tool, in all four shapes, against a provider whose reasoning -- levels come from the protocol rather than models.toml. scenario("catalog", function() local install = make_install("catalog") |
