Dashboard › opencode-lore › Distillation
6e5d0342-21c8-4abd-810a-ed1ebc0fee58["lore_tm_v1_9iEXzn5VDzGCPNwDfLPoHQe-oUgA3wWhE9MaGxgV_no","lore_tm_v1_XS2AFQmE5uI81fj8NuEGYVyakMyK6T-gUEyhwyQruCM"]
Date: Sep 16, 2026
packages/core/test/embedding-pool.test.ts “never touches” the per-worker OOM/self-heal lifecycle; that lifecycle is covered separately in embedding-oom-recovery.test.ts.packages/core/test/embedding-pool.test.ts is a 1,650-line Vitest suite for EmbeddingPool cross-worker dispatch issue #999, covering least-busy routing, lazy and memory-gated growth, the broken-provider latch, and pool shutdown.packages/core/test/embedding-pool.test.ts defines a controllable FakeWorker extends EventEmitter using the _setTestWorkerFactory seam. It records embedIds and embedPostCount, tracks gotShutdown and terminated, supports throwOnNextEmbed, and provides completeAll(), completeNext(), startNext(), initError(), crash(), and exit() controls.FakeWorker.postMessage() throws Error("worker died before postMessage") when throwOnNextEmbed is set; embed results contain vectors: [new Float32Array([1, 0, 0])]; shutdown normally emits exit with code 0; terminate() marks the worker terminated and resolves to 0.packages/core/test/embedding-pool.test.ts include installFakeWorkers(), flush() with two sets of 8 microtask flushes around setTimeout(..., 0), flushFakeTimers() using vi.advanceTimersByTimeAsync(0), settle<T>() for immediately handled promise outcomes, and warmPool() using embed(["bootstrap"], "document").beforeEach() forces the local provider by removing VOYAGE_API_KEY, OPENAI_API_KEY, and LORE_EMBED_POOL_SIZE; neutralizes real CI cgroup limits with _setConstrainedMemoryForTest(0); resets the local-provider probe; and saves/clears the provider.afterEach() restores worker factories, pool sizing, watchdogs, cooldowns, memory test overrides, provider state, VOYAGE_API_KEY, OPENAI_API_KEY, LORE_EMBED_POOL_SIZE, and NODE_ENV; defensively calls _setRecallEmbedsInFlightForTest(0); resets shutdown tracking; and restores real timers.serializes cold bootstrap before enabling parallel dispatch configures pool size 2 and 64 * GB free memory. Two initial concurrent requests (alpha, beta) use only one worker and dispatch one native batch until a real result proves model readiness, preventing sibling initializers from racing the shared model cache; after bootstrap, concurrent gamma and delta requests grow the pool to 2 workers and dispatch one request to each.does not spawn a second worker for sequential (non-concurrent) embeds configures pool size 2 and 64 * GB free memory, then verifies sequential alpha and beta requests reuse worker 0 and do not load a second model.removes a cancelled queued request without restarting its worker configures pool size 1, uses 64 * GB free memory, warms the pool, queues blocked and cancelled requests, aborts cancelled through an AbortController, and verifies only one request reached the existing worker before cancellation.