Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

test(bench): run the agent bench against LU's own engine as a test instance (CA)

purpleba3303dfed74
diff --git a/e2e/agent-live/run.bench.ts b/e2e/agent-live/run.bench.ts
index ea2a8110..d139ef7e 100644
--- a/e2e/agent-live/run.bench.ts
+++ b/e2e/agent-live/run.bench.ts
@@ -18,6 +18,11 @@ const RUNS = Number(process.env.LU_BENCH_RUNS) || 1
const RUN_MS = Number(process.env.LU_BENCH_RUN_MS) || 10 * 60_000
/** Cloud mode: the picker lists LU Cloud models. Needs a signed-in session. */
const CLOUD = process.env.LU_BENCH_CLOUD === '1'
+/** CA: LU's own engine (the bundled llama-server, same binary and flags) run as
+ * a test instance on its own port, e.g. http://127.0.0.1:18731/v1. The app
+ * reaches it through the same OpenAI-compatible slot the built-in engine
+ * uses; only the lifecycle is outside the app. Ollama stays off. */
+const ENGINE_URL = process.env.LU_BENCH_ENGINE_URL || ''
const STORES = [
'/src/stores/chatStore.ts',
@@ -27,6 +32,7 @@ const STORES = [
'/src/stores/codexStore.ts',
'/src/stores/toolAuditStore.ts',
'/src/stores/generationStore.ts',
+ '/src/stores/providerStore.ts',
]
const tasks = TASKS.filter((t) => !WANTED.length || WANTED.includes(t.id))
@@ -47,6 +53,17 @@ async function boot(page: Page) {
// measured time.
A['/src/stores/settingsStore.ts'].useSettingsStore.getState().updateSettings({ codexDefaultMode: 'bypass' })
})
+ if (ENGINE_URL) {
+ await page.evaluate((url) => {
+ const A = (window as unknown as AppWindow).__APP__
+ const prov = A['/src/stores/providerStore.ts'].useProviderStore.getState()
+ prov.setProviderConfig('openai', { enabled: true, baseUrl: url, managed: false })
+ prov.setProviderConfig('ollama', { enabled: false })
+ }, ENGINE_URL)
+ // The picker reads the providers when it loads its list.
+ await page.reload()
+ await appModules(page, STORES)
+ }
}
async function pickModel(page: Page, label: string) {
diff --git a/e2e/hintergrund-fragt-nicht.spec.ts b/e2e/hintergrund-fragt-nicht.spec.ts
index 7ecbb2f2..a4986392 100644
--- a/e2e/hintergrund-fragt-nicht.spec.ts
+++ b/e2e/hintergrund-fragt-nicht.spec.ts
@@ -100,5 +100,6 @@ test('drei Delegationen erzeugen keine einzige Freigabefrage', async ({ page })
// Und es waren wirklich drei Delegationen, nicht eine. Die Leiste faltet
// gleichartige Aufrufe zusammen, also erst aufklappen.
await page.getByRole('button', { name: /3 steps/ }).click()
- await expect(page.getByText('delegate_task', { exact: true })).toHaveCount(3)
+ // CA U1: the rows read "Handed off …"; the tool's own name is the tooltip.
+ await expect(page.getByTitle('delegate_task', { exact: true })).toHaveCount(3)
})