diff --git a/src/auto-reply/reply.triggers.trigger-handling.allows-activation-from-allowfrom-groups.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.allows-activation-from-allowfrom-groups.e2e.test.ts index 46fbba9ff..97b8794fd 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.allows-activation-from-allowfrom-groups.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.allows-activation-from-allowfrom-groups.e2e.test.ts @@ -1,7 +1,6 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; -import { describe, expect, it } from "vitest"; -import { getReplyFromConfig } from "./reply.js"; +import { beforeAll, describe, expect, it } from "vitest"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, @@ -9,6 +8,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.allows-approved-sender-toggle-elevated-mode.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.allows-approved-sender-toggle-elevated-mode.e2e.test.ts index dcfbd2f2b..eaf069adf 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.allows-approved-sender-toggle-elevated-mode.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.allows-approved-sender-toggle-elevated-mode.e2e.test.ts @@ -1,7 +1,6 @@ import fs from "node:fs/promises"; import { join } from "node:path"; -import { describe, expect, it } from "vitest"; -import { getReplyFromConfig } from "./reply.js"; +import { beforeAll, describe, expect, it } from "vitest"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, @@ -9,6 +8,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.allows-elevated-off-groups-without-mention.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.allows-elevated-off-groups-without-mention.e2e.test.ts index baa4ac2ec..098a61876 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.allows-elevated-off-groups-without-mention.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.allows-elevated-off-groups-without-mention.e2e.test.ts @@ -1,7 +1,6 @@ import fs from "node:fs/promises"; -import { describe, expect, it } from "vitest"; +import { beforeAll, describe, expect, it } from "vitest"; import { loadSessionStore } from "../config/sessions.js"; -import { getReplyFromConfig } from "./reply.js"; import { installTriggerHandlingE2eTestHooks, MAIN_SESSION_KEY, @@ -9,6 +8,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.filters-usage-summary-current-model-provider.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.filters-usage-summary-current-model-provider.e2e.test.ts index 4f4bff874..2477872e2 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.filters-usage-summary-current-model-provider.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.filters-usage-summary-current-model-provider.e2e.test.ts @@ -1,8 +1,7 @@ import { readFile } from "node:fs/promises"; import { join } from "node:path"; -import { describe, expect, it } from "vitest"; +import { beforeAll, describe, expect, it } from "vitest"; import { normalizeTestText } from "../../test/helpers/normalize-text.js"; -import { getReplyFromConfig } from "./reply.js"; import { getProviderUsageMocks, getRunEmbeddedPiAgentMock, @@ -11,6 +10,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); const usageMocks = getProviderUsageMocks(); diff --git a/src/auto-reply/reply.triggers.trigger-handling.handles-inline-commands-strips-it-before-agent.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.handles-inline-commands-strips-it-before-agent.e2e.test.ts index 9f1a79b63..823cdc6b5 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.handles-inline-commands-strips-it-before-agent.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.handles-inline-commands-strips-it-before-agent.e2e.test.ts @@ -1,5 +1,4 @@ -import { describe, expect, it } from "vitest"; -import { getReplyFromConfig } from "./reply.js"; +import { beforeAll, describe, expect, it } from "vitest"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, @@ -7,6 +6,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.ignores-inline-elevated-directive-unapproved-sender.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.ignores-inline-elevated-directive-unapproved-sender.e2e.test.ts index f3c0add19..cd4648af7 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.ignores-inline-elevated-directive-unapproved-sender.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.ignores-inline-elevated-directive-unapproved-sender.e2e.test.ts @@ -1,7 +1,6 @@ import fs from "node:fs/promises"; import { join } from "node:path"; -import { describe, expect, it } from "vitest"; -import { getReplyFromConfig } from "./reply.js"; +import { beforeAll, describe, expect, it } from "vitest"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, @@ -10,6 +9,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.includes-error-cause-embedded-agent-throws.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.includes-error-cause-embedded-agent-throws.e2e.test.ts index a4c7d447e..cb87d1fff 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.includes-error-cause-embedded-agent-throws.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.includes-error-cause-embedded-agent-throws.e2e.test.ts @@ -1,6 +1,5 @@ import fs from "node:fs/promises"; -import { describe, expect, it } from "vitest"; -import { getReplyFromConfig } from "./reply.js"; +import { beforeAll, describe, expect, it } from "vitest"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, @@ -10,6 +9,11 @@ import { } from "./reply.triggers.trigger-handling.test-harness.js"; import { HEARTBEAT_TOKEN } from "./tokens.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.keeps-inline-status-unauthorized-senders.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.keeps-inline-status-unauthorized-senders.e2e.test.ts index f5a0f9b85..130536996 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.keeps-inline-status-unauthorized-senders.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.keeps-inline-status-unauthorized-senders.e2e.test.ts @@ -1,6 +1,5 @@ import fs from "node:fs/promises"; -import { describe, expect, it } from "vitest"; -import { getReplyFromConfig } from "./reply.js"; +import { beforeAll, describe, expect, it } from "vitest"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, @@ -9,6 +8,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.reports-active-auth-profile-key-snippet-status.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.reports-active-auth-profile-key-snippet-status.e2e.test.ts index 1f7d9f43f..7c998c048 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.reports-active-auth-profile-key-snippet-status.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.reports-active-auth-profile-key-snippet-status.e2e.test.ts @@ -1,8 +1,7 @@ import fs from "node:fs/promises"; import { join } from "node:path"; -import { describe, expect, it } from "vitest"; +import { beforeAll, describe, expect, it } from "vitest"; import { resolveSessionKey } from "../config/sessions.js"; -import { getReplyFromConfig } from "./reply.js"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, @@ -10,6 +9,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.runs-compact-as-gated-command.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.runs-compact-as-gated-command.e2e.test.ts index 13f5815c4..eb5749144 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.runs-compact-as-gated-command.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.runs-compact-as-gated-command.e2e.test.ts @@ -1,8 +1,7 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; -import { describe, expect, it } from "vitest"; +import { beforeAll, describe, expect, it } from "vitest"; import { loadSessionStore, resolveSessionKey } from "../config/sessions.js"; -import { getReplyFromConfig } from "./reply.js"; import { getCompactEmbeddedPiSessionMock, getRunEmbeddedPiAgentMock, @@ -11,6 +10,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.runs-greeting-prompt-bare-reset.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.runs-greeting-prompt-bare-reset.e2e.test.ts index 3beb42778..273ac1941 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.runs-greeting-prompt-bare-reset.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.runs-greeting-prompt-bare-reset.e2e.test.ts @@ -1,13 +1,17 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; -import { describe, expect, it } from "vitest"; -import { getReplyFromConfig } from "./reply.js"; +import { beforeAll, describe, expect, it } from "vitest"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.shows-endpoint-default-model-status-not-configured.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.shows-endpoint-default-model-status-not-configured.e2e.test.ts index 832dc2a09..65a03fc41 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.shows-endpoint-default-model-status-not-configured.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.shows-endpoint-default-model-status-not-configured.e2e.test.ts @@ -1,6 +1,5 @@ -import { describe, expect, it } from "vitest"; +import { beforeAll, describe, expect, it } from "vitest"; import { normalizeTestText } from "../../test/helpers/normalize-text.js"; -import { getReplyFromConfig } from "./reply.js"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, @@ -8,6 +7,11 @@ import { withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.shows-quick-model-picker-grouped-by-model.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.shows-quick-model-picker-grouped-by-model.e2e.test.ts index 97a318641..6b0fc5fe4 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.shows-quick-model-picker-grouped-by-model.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.shows-quick-model-picker-grouped-by-model.e2e.test.ts @@ -1,13 +1,17 @@ -import { describe, expect, it } from "vitest"; +import { beforeAll, describe, expect, it } from "vitest"; import { normalizeTestText } from "../../test/helpers/normalize-text.js"; import { loadSessionStore } from "../config/sessions.js"; -import { getReplyFromConfig } from "./reply.js"; import { installTriggerHandlingE2eTestHooks, makeCfg, withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => { diff --git a/src/auto-reply/reply.triggers.trigger-handling.targets-active-session-native-stop.e2e.test.ts b/src/auto-reply/reply.triggers.trigger-handling.targets-active-session-native-stop.e2e.test.ts index 21452d854..e372953b6 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.targets-active-session-native-stop.e2e.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.targets-active-session-native-stop.e2e.test.ts @@ -1,8 +1,7 @@ import fs from "node:fs/promises"; import { join } from "node:path"; -import { describe, expect, it } from "vitest"; +import { beforeAll, describe, expect, it } from "vitest"; import { loadSessionStore } from "../config/sessions.js"; -import { getReplyFromConfig } from "./reply.js"; import { getAbortEmbeddedPiRunMock, getRunEmbeddedPiAgentMock, @@ -13,6 +12,11 @@ import { } from "./reply.triggers.trigger-handling.test-harness.js"; import { enqueueFollowupRun, getFollowupQueueDepth, type FollowupRun } from "./reply/queue.js"; +let getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; +beforeAll(async () => { + ({ getReplyFromConfig } = await import("./reply.js")); +}); + installTriggerHandlingE2eTestHooks(); describe("trigger handling", () => {