the real-browser test is opt-in (STRATA_TEST_BROWSER=1); HTTP driver goal bar command

This commit is contained in:
Niko1221 committed 2026-10-16 14:08:27 +02:00
1 parent 04cca3bca8
commit c99896ae66
2 files changed
+16 -1

No files matched your search

+14
View File
@@ -88,6 +88,20 @@ if (command === 'connect') {
console.log(`${stamp()} -- clear`, JSON.stringify(await j('/api/goal/clear', { chatId: chat })));
console.log(`${stamp()} -- state after clear`, JSON.stringify(await j(`/api/goal?chatId=${chat}`)));
void last;
} else if (command === 'goalbar') {
// Pause from the goal bar while a round runs, then resume through the chat stream.
const [objective, pauseAfter = '6'] = rest;
const chat = process.env.CHAT ?? `gb-${Date.now()}`;
const common = { sessionId: chat, mode: 'bypass', remoteModel: await model() };
const running = stream({ ...common, message: `/goal ${objective}` });
await sleep(Number(pauseAfter) * 1000);
console.log(`${stamp()} -- pause from the bar`, JSON.stringify(await j('/api/goal/pause', { chatId: chat })));
await running;
console.log(`${stamp()} -- state after the run`, JSON.stringify((await j(`/api/goal?chatId=${chat}`)).goal));
console.log(`${stamp()} -- resume (stream, no message)`);
await stream({ ...common, goalAction: 'resume' });
console.log(`${stamp()} -- state after resume`, JSON.stringify((await j(`/api/goal?chatId=${chat}`)).goal));
console.log(`${stamp()} -- remove`, JSON.stringify(await j('/api/goal/clear', { chatId: chat })));
} else if (command === 'timeskip') {
const [request, stopAfter] = rest;
const chat = process.env.CHAT ?? `t-${Date.now()}`;
@@ -372,7 +372,8 @@ test('browser: the tool server is found in the agent component; the screen can s
const browserNow = findBrowser();
const playwrightCli = HARNESS ? findPlaywrightMcp(HARNESS) : null;
const browserSkip = skip || !browserNow.found || !playwrightCli ? 'needs STRATA_HARNESS_DIR with the browser tool server and Chrome or Edge on this computer' : false;
// Opt-in: it starts a real (headless) Chrome, which a test run must not do on someone's PC unasked.
const browserSkip = process.env.STRATA_TEST_BROWSER !== '1' ? 'starts a real browser: set STRATA_TEST_BROWSER=1' : skip || !browserNow.found || !playwrightCli ? 'needs STRATA_HARNESS_DIR with the browser tool server and Chrome or Edge on this computer' : false;
test('real browser: the assistant opens a local page in the person\'s Chrome or Edge and reads it; Manual asks before opening it, Plan refuses', { skip: browserSkip, timeout: 240000 }, async (t) => {
const http = await import('node:http');