Elffuss BraidHub

utopia-ia/elffuss-code public

Tests: pin Basic mode in the suites that bring their own provider

toolparse, toolparse_missingbrace and the four batteries (edit-bateria,
goalfail, retry-test, run-bateria) open the IDE and replace the provider with a
stand-in, but did not pin a model. Opening the page starts preloadModel(), so
with a GPU (the batteries launch the installed Chrome) a Gemma load ran on the
GPU during the test, and without one the light ONNX model is now downloaded and
run on the CPU (the IDE loads it again since "Without WebGPU the IDE loads the
light ONNX model again"). They pin Basic mode like the other suites; their
checks are unchanged and pass.
Changeset4823c78abba49df9678e52a2e362ad9b16cfb83e756859e486a00136876b58b3
AuthorKikoCis <kikocisneros@gmail.com> · 2026-10-11 15:43 +02:00
CommitterKikoCis <kikocisneros@gmail.com> · 2026-10-11 15:43 +02:00
Parentse5e3d9f72068

Browse the files at this changeset

6 files changed

modified tests/edit-bateria.mjs +6 −1
@@ -112,7 +112,12 @@
112112 ];
113113
114114 const b = await chromium.launch({ channel: 'chrome', headless: true });
115-const p = await (await b.newContext()).newPage();
115+// Modo Básico: esta prueba pone su propio proveedor y no necesita modelo. Sin
116+// esto, al abrir la página main.js se pone a cargar el modelo local por defecto
117+// (con GPU, Gemma; sin ella, el ONNX ligero) mientras la prueba corre.
118+const ctxPrueba = await b.newContext();
119+await ctxPrueba.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
120+const p = await ctxPrueba.newPage();
116121 // Por defecto contra producción, como siempre; BASE=… la corre contra otro
117122 // servidor (un árbol local), que es lo que hace falta antes de desplegar.
118123 await p.goto((process.env.BASE || 'https://code.elffuss.com') + '/', { waitUntil: 'domcontentloaded' });
modified tests/goalfail.mjs +6 −1
@@ -2,7 +2,12 @@
22 // como hecha. Proveedor de guion (sin GPU, sin modelo), determinista.
33 import { chromium } from 'playwright';
44 const b = await chromium.launch({ channel: 'chrome', headless: true });
5-const p = await (await b.newContext()).newPage();
5+// Modo Básico: esta prueba pone su propio proveedor y no necesita modelo. Sin
6+// esto, al abrir la página main.js se pone a cargar el modelo local por defecto
7+// (con GPU, Gemma; sin ella, el ONNX ligero) mientras la prueba corre.
8+const ctxPrueba = await b.newContext();
9+await ctxPrueba.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
10+const p = await ctxPrueba.newPage();
611 const errs = []; p.on('pageerror', e => errs.push(e.message.slice(0, 80)));
712 // Por defecto contra producción, como siempre; BASE=… la corre contra otro
813 // servidor (un árbol local), que es lo que hace falta antes de desplegar.
modified tests/retry-test.mjs +6 −1
@@ -3,7 +3,12 @@
33 // 2ª vez, viendo el ERROR + la pista en el historial, corrige y lee el bueno.
44 import { chromium } from 'playwright';
55 const b = await chromium.launch({ channel: 'chrome', headless: true });
6-const p = await (await b.newContext()).newPage();
6+// Modo Básico: esta prueba pone su propio proveedor y no necesita modelo. Sin
7+// esto, al abrir la página main.js se pone a cargar el modelo local por defecto
8+// (con GPU, Gemma; sin ella, el ONNX ligero) mientras la prueba corre.
9+const ctxPrueba = await b.newContext();
10+await ctxPrueba.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
11+const p = await ctxPrueba.newPage();
712 // Por defecto contra producción, como siempre; BASE=… la corre contra otro
813 // servidor (un árbol local), que es lo que hace falta antes de desplegar.
914 await p.goto((process.env.BASE || 'https://code.elffuss.com') + '/', { waitUntil: 'domcontentloaded' });
modified tests/run-bateria.mjs +6 −1
@@ -55,7 +55,12 @@
5555 ];
5656
5757 const b = await chromium.launch({ channel: 'chrome', headless: true });
58-const p = await (await b.newContext()).newPage();
58+// Modo Básico: esta prueba pone su propio proveedor y no necesita modelo. Sin
59+// esto, al abrir la página main.js se pone a cargar el modelo local por defecto
60+// (con GPU, Gemma; sin ella, el ONNX ligero) mientras la prueba corre.
61+const ctxPrueba = await b.newContext();
62+await ctxPrueba.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
63+const p = await ctxPrueba.newPage();
5964 // Por defecto contra producción, como siempre; BASE=… la corre contra otro
6065 // servidor (un árbol local), que es lo que hace falta antes de desplegar.
6166 await p.goto((process.env.BASE || 'https://code.elffuss.com') + '/', { waitUntil: 'domcontentloaded' });
modified tests/toolparse.mjs +7 −1
@@ -2,7 +2,13 @@
22 const BASE = process.env.BASE || 'http://localhost:8799';
33 let fails = 0;
44 const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
5-const b = await chromium.launch(); const p = await (await b.newContext()).newPage();
5+const b = await chromium.launch();
6+// Modo Básico: esta prueba pone su propio proveedor y no necesita modelo. Sin
7+// esto, al abrir la página main.js se pone a cargar el modelo local por defecto
8+// (con GPU, Gemma; sin ella, el ONNX ligero) mientras la prueba corre.
9+const ctxPrueba = await b.newContext();
10+await ctxPrueba.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
11+const p = await ctxPrueba.newPage();
612 await p.goto(BASE + '/', { waitUntil: 'domcontentloaded' });
713 const parse = (t) => p.evaluate(async (t) => { const a = await import('/js/agent.js'); return a.parseToolCalls(t); }, t);
814
modified tests/toolparse_missingbrace.mjs +6 −1
@@ -9,7 +9,12 @@
99 let fails = 0; const ok = (n, c, e = '') => { console.log((c ? '✅' : '❌') + ' ' + n + (e ? ' — ' + e : '')); if (!c) fails++; };
1010
1111 const b = await chromium.launch();
12-const p = await b.newPage();
12+// Modo Básico: esta prueba pone su propio proveedor y no necesita modelo. Sin
13+// esto, al abrir la página main.js se pone a cargar el modelo local por defecto
14+// (con GPU, Gemma; sin ella, el ONNX ligero) mientras la prueba corre.
15+const ctxPrueba = await b.newContext();
16+await ctxPrueba.addInitScript(() => { try { localStorage.setItem('elffusscode.model', 'rules'); } catch {} });
17+const p = await ctxPrueba.newPage();
1318 await p.goto(BASE + '/', { waitUntil: 'domcontentloaded' });
1419
1520 const run = text => p.evaluate(async t => {