repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

test(goal): isolate configured judge model

65add84025395d4c6e56c712ebd867ee4cd61023

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (1)

extensions/goal/__tests__/integration-full.test.ts

Modified
29 29 return fileURLToPath(new URL("../index.ts", import.meta.url));
32 -function createGoalSession(
32 +async function createGoalSession(
33 33 options: Omit<
34 34 Parameters<typeof createTestSession>[0],
35 35 "extensions" | "extensionFactories"
36 36 > = {},
38 - return createTestSession({ ...options, extensionFactories: [goalExtension] });
38 + const session = await createTestSession({
39 + ...options,
40 + extensionFactories: [goalExtension],
41 + });
42 + mkdirSync(join(session.cwd, ".pi"), { recursive: true });
43 + writeFileSync(
44 + join(session.cwd, ".pi", "settings.json"),
45 + JSON.stringify({ goal: { judgeModel: "openai/gpt-4o" } }),
46 + );
47 + return session;
41 50 function doneEvent(text: string) {
626 635 mkdirSync(join(t.cwd, ".pi"), { recursive: true });
627 636 writeFileSync(
628 637 join(t.cwd, ".pi", "settings.json"),
629 - JSON.stringify({ retry: { enabled: false } }),
638 + JSON.stringify({
639 + goal: { judgeModel: "openai/gpt-4o" },
640 + retry: { enabled: false },
641 + }),
631 643 installSaysErrorStream(t, "WebSocket closed 1006 Connection ended");
650 662 mkdirSync(join(t.cwd, ".pi"), { recursive: true });
651 663 writeFileSync(
652 664 join(t.cwd, ".pi", "settings.json"),
653 - JSON.stringify({ retry: { enabled: true, maxRetries: 1 } }),
665 + JSON.stringify({
666 + goal: { judgeModel: "openai/gpt-4o" },
667 + retry: { enabled: true, maxRetries: 1 },
668 + }),
655 670 t.session.settingsManager.applyOverrides({
656 671 retry: { enabled: true, maxRetries: 1, baseDelayMs: 10_000 },