From e2d03ac4fa0905625b11ffa0880dedd2792c501c Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Sun, 18 Oct 2026 13:41:41 +0200 Subject: [PATCH] scripted worker: multi script ends with its own text --- apps/host/tests/helpers/scripted-worker.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/host/tests/helpers/scripted-worker.mjs b/apps/host/tests/helpers/scripted-worker.mjs index 360c6ecd..2ebee5e8 100644 --- a/apps/host/tests/helpers/scripted-worker.mjs +++ b/apps/host/tests/helpers/scripted-worker.mjs @@ -127,6 +127,11 @@ export async function startScriptedWorker({ port = 0, chunkDelayMs = 40, model = } if (directive?.[1] === 'planslow') return say(['## Slow plan\n\n', '1. First thing SCRIPT:goalstep\n', '2. A step that never finishes SCRIPT:slow 4000\n', '3. Third thing SCRIPT:goalstep\n']); if (directive?.[1] === 'planreply') return say(['I looked around the folder first.\n\n## The pagoda plan\n\n', '1. First thing SCRIPT:goalstep\n', '2. Second thing SCRIPT:goalstep\n', '3. Third thing SCRIPT:goalstep\n']); + if (directive?.[1] === 'multi' && last.role === 'tool') { + let cfg = {}; + try { cfg = JSON.parse((directive[2] ?? '').trim()); } catch { /* a test bug */ } + return say([String(cfg.say ?? 'Done.')]); + } if (last.role === 'tool') { const result = text(last).replace(/\s+/g, ' ').slice(0, 120); return say(['Tool finished. ', `Result: ${result}`]);