Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

scripts: agent-flow checks per-chat model and two chats at once

Niko1221178bde4ce608
diff --git a/apps/host/scripts/agent-flow.mjs b/apps/host/scripts/agent-flow.mjs
index 9e7f8efaa..cb1f6c428 100644
--- a/apps/host/scripts/agent-flow.mjs
+++ b/apps/host/scripts/agent-flow.mjs
@@ -110,6 +110,37 @@ try {
await shot(page, '07-after-reopen');
check(await page.locator('.toolcard').count() === 0 && await page.locator('.tool-summary').count() === 1, 'reopening shows the one finished tool and no new card (nothing replayed)');
if (process.env.EXPECT_AFTER) check(await page.getByText(new RegExp(process.env.EXPECT_AFTER)).count() >= 1, `the reopened chat answered (${process.env.EXPECT_AFTER})`);
+ // 5. the model choice belongs to the chat: a new chat starts on the local model again
+ await page.getByRole('button', { name: 'New chat' }).first().click();
+ await page.waitForTimeout(600);
+ const fresh = await page.getByRole('button', { name: /Choose model/ }).first().getAttribute('aria-label');
+ check(!fresh?.includes(MODEL), `a new chat does not inherit the API model (picker says: ${fresh})`);
+ await shot(page, '08-new-chat-model');
+
+ // 6. two chats at once (optional: a real model has one inference slot, so the second just queues)
+ if (process.env.TWO_CHATS === '1') {
+ await page.locator('a.navsession').nth(1).click().catch(() => {});
+ await page.getByRole('button', { name: 'New chat' }).first().click();
+ await page.getByRole('button', { name: /Choose model/ }).first().click();
+ await page.getByRole('menuitemradio', { name: new RegExp(MODEL) }).first().click();
+ await send(process.env.PROMPT_A ?? 'SCRIPT:slow 150');
+ await page.waitForFunction(() => document.documentElement.dataset.streaming === 'true');
+ await page.waitForTimeout(800);
+ await page.getByRole('button', { name: 'New chat' }).first().click();
+ await page.getByRole('button', { name: /Choose model/ }).first().click();
+ await page.getByRole('menuitemradio', { name: new RegExp(MODEL) }).first().click();
+ check(await page.getByRole('button', { name: 'Send' }).count() === 1, 'the second chat can send while the first is mid-turn');
+ await send(process.env.PROMPT_B ?? 'SCRIPT:echo the other chat');
+ await page.getByText(process.env.EXPECT_B ?? 'the other chat').first().waitFor({ timeout: 60000 });
+ const stillRunning = await page.evaluate(() => document.documentElement.dataset.streaming);
+ await shot(page, '09-two-chats-second-done');
+ check(stillRunning === 'true', 'the first chat is still running when the second one has answered');
+ await idle();
+ await page.locator('a.navsession').first().click();
+ await page.waitForTimeout(500);
+ await shot(page, '10-two-chats-first-done');
+ check(await page.getByText(/w149/).count() >= 1, 'the first chat finished its own stream');
+ }
check(problems.length === 0, `no page errors (${problems.join(' | ') || 'none'})`);
} catch (error) {
failed = true;