From f37abb13654a077ae9dedd6eea077605ab45f9b4 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Fri, 16 Oct 2026 19:25:32 +0200 Subject: [PATCH] Tests follow the new reply room; the queued-message test waits for the goal to be running --- apps/host/tests/agent-plan-run.test.mjs | 7 +++++-- apps/host/tests/agent-tools.test.mjs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/host/tests/agent-plan-run.test.mjs b/apps/host/tests/agent-plan-run.test.mjs index 147eb117..29f17670 100644 --- a/apps/host/tests/agent-plan-run.test.mjs +++ b/apps/host/tests/agent-plan-run.test.mjs @@ -92,8 +92,11 @@ test('a message typed while a goal without points runs is queued, can be taken b assert.throws(() => r.bridge.queueMessage({ chatId: 'q1', text: 'hello' }), /No goal is running/); const out = []; const run = r.bridge.runTurn({ ...r.base('q1', f => out.push(f)), goal: { action: 'create', objective: 'keep going', maxRounds: 50 } }); - await wait(3000); - const a = r.bridge.queueMessage({ chatId: 'q1', text: 'first thing' }); + // the goal turn may take a while to start on a busy machine: queue as soon as it runs + let a = null; + for (let i = 0; i < 150 && !a; i++) { try { a = r.bridge.queueMessage({ chatId: 'q1', text: 'first thing' }); } catch { await wait(100); } } + assert.ok(a, 'the goal was running'); + await wait(500); const b = r.bridge.queueMessage({ chatId: 'q1', text: 'second thing' }); assert.equal(a.message.deliverAt, 'end'); assert.deepEqual(b.queue.map(m => m.text), ['first thing', 'second thing']); const back = r.bridge.cancelQueued({ chatId: 'q1', id: b.message.id }); diff --git a/apps/host/tests/agent-tools.test.mjs b/apps/host/tests/agent-tools.test.mjs index a35986fb..baffeb31 100644 --- a/apps/host/tests/agent-tools.test.mjs +++ b/apps/host/tests/agent-tools.test.mjs @@ -237,7 +237,7 @@ test('the output budget is not the old 8192, and the Reasoning menu reaches the const off = await ask('think-off', 'Off'); assert.equal(ctk(off).enable_thinking, false); assert.equal(ctk(off).reasoning_effort, undefined); assert.equal(off.enable_thinking, undefined, 'a top-level enable_thinking is the field the Strata server ignores'); - assert.ok(off.max_completion_tokens > 40000, `budget ${off.max_completion_tokens} (the window minus the prompt, never the old 8192)`); + assert.ok(off.max_completion_tokens >= 32000 && off.max_completion_tokens <= 32768, `budget ${off.max_completion_tokens} (half the window, at most 32K: never the old 8192, and room is left for the conversation to be compacted)`); const high = await ask('think-high', 'High'); assert.equal(ctk(high).enable_thinking, true); assert.equal(ctk(high).reasoning_effort, 'high'); const low = await ask('think-low', 'Low');