Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(test): reset AI gateway after adaptive-embed-batch suite — cross-file config leak (#3065)
Time Attakcb6dd3e11216c
diff --git a/test/ai/adaptive-embed-batch.test.ts b/test/ai/adaptive-embed-batch.test.tsindex 33050d4d4c..505c7c82f3 100644--- a/test/ai/adaptive-embed-batch.test.ts+++ b/test/ai/adaptive-embed-batch.test.ts@@ -28,7 +28,7 @@* (excluding the OpenAI canonical fast-path recipe).*/-import { afterEach, beforeEach, describe, expect, mock, test } from 'bun:test';+import { afterAll, afterEach, beforeEach, describe, expect, mock, test } from 'bun:test';import {configureGateway,resetGateway,@@ -40,6 +40,15 @@ import {} from '../../src/core/ai/gateway.ts';import { AIConfigError, AITransientError } from '../../src/core/ai/errors.ts';+// The last test in this file leaves the gateway configured with a remote+// provider + fake key and a REAL embed transport. Without a final reset,+// that config leaks into whichever test file the shard runs next — the+// first downstream embed then makes a live HTTP call (broke master shard 6+// when #3022's new test file reshuffled shard composition). The bunfig+// legacy-embedding preload only re-applies its default when the gateway is+// UNCONFIGURED, so a configured-but-stale slot survives file boundaries.+afterAll(() => resetGateway());+// --------- Test helpers ---------/**