Dashboard › opencode-lore › Distillation
1be146d3-6956-43ae-a8b5-7be65970189f["lore_tm_v1_duRrFgJuo15P4PNGqZfGVWAyoa9NvCI3BuVEIoXUexw","lore_tm_v1_kpStxDuPj5H-WlQNMXU9sn6IjMqvCqP607CpE2E-lSE","lore_tm_v1_-ITLhpMLoSJLT9Gng7OLWJsvJni9cMkfBdu5CFjB6rU","lore_tm_v1_mULZBBzO6E5Sxp4iP00wf0EAqN0PtlYP6S5diuu3Hp8","lore_tm_v1_L_7JLY6CvDnBSA4cGbOHVk43TIw9O35-0hxOnCMxGUE","lore_tm_v1_KMQ7dFOf9UgDkzW8ya0myq54cq1vIrLIsgvAYgzw7KM","lore_tm_v1_lDGnbiE4CgN8KFx7LAlPZsze_u3ftsI6_xe2eO_Kbz4"]
Date: Sep 17, 2026
"unhandled"."busy" state.packages/core/test/embedding-oom-recovery.test.ts uses FakeWorker extends EventEmitter and _setTestWorkerFactory to deterministically exercise the live LocalProvider OOM lifecycle: worker "exit" with EMBED_OOM_EXIT_CODE → handleOomBackoff → resubmitPending, floor latching, and synchronous respawn failure.FakeWorker.postMessage() snapshots each EmbedMsg as { type, id, maxTokens } because production mutates p.payload.maxTokens in place during resubmission; retaining object references would retroactively alter earlier captured messages.settle<T>() in packages/core/test/embedding-oom-recovery.test.ts immediately attaches fulfillment and rejection handlers, returning { ok: true, value } or { ok: false, err }, so early worker-driven rejections are not reported as unhandled.VOYAGE_API_KEY and OPENAI_API_KEY, sets _setConstrainedMemoryForTest(0) and _setContainerFreeForTest(16 * 1024 * 1024 * 1024), resets the local-provider probe, and saves/clears the provider. Teardown restores environment variables and provider state and clears worker and memory overrides._persistEmbedCap(8192, 0), verifies the first request starts at EMBED_TOKEN_CEILING, emits EMBED_OOM_EXIT_CODE, and verifies a fresh worker receives the same request ID at backoffEmbedCap(EMBED_TOKEN_CEILING), strictly below the first cap. The lowered cap is persisted through _readPersistedEmbedCap(), and the original promise resolves when the replacement worker returns one vector.MIN_EMBED_TOKENS, triggers OOM at that floor, and verifies there is no respawn, the pending request rejects with LocalProviderUnavailableError, and isAvailable() becomes false for FTS-only degradation._setTestWorkerFactory invocation throw Error("synthetic spawn failure"); it verifies exactly 2 spawn calls and that the otherwise orphaned pending request rejects with LocalProviderUnavailableError.EMBED_OOM_EXIT_CODE for at most 30 iterations, verifies caps are monotonically non-increasing, reaches MIN_EMBED_TOKENS, then latches without another respawn; the pending request rejects with LocalProviderUnavailableError and isAvailable() is false.silenceStderr(true) and verifies every worker spawn snapshots the host’s live stderr-silence state into workerData.stderrSilenced; this prevents a worker thread’s [lore] OOM output from corrupting the host TUI.packages/core/src/embedding/runtime.ts uses providerAdmissionClosed as a one-way process-shutdown latch and OwnedRetirements<object> as providerGenerations, retaining ownership of every local-provider generation until worker termination is known.resetProvider(timeoutMs?) tracks EmbeddingPool.shutdown(timeoutMs) through trackProviderGenerationShutdown() and sets cachedProvider to null when providerAdmissionClosed is already true, otherwise to undefined; this allows normal config reset to create a fresh generation without permitting late reset callbacks to reopen admission after shutdown.shutdownProvider(timeoutMs?) first sets providerAdmissionClosed = true, tracks shutdown of the current EmbeddingPool, sets cachedProvider = null, then awaits settleProviderGenerations(); failure to confirm termination uses message "embedding worker termination was not confirmed"._shutdownAndDisable is retained as a deprecated compatibility alias for shutdownProvider; _resetProviderShutdownTrackingForTest() clears settled generation failures._saveAndClearProvider() preserves both cachedProvider and providerAdmissionClosed, temporarily resets admission to open and clears the cache; _restoreProvider() restores both fields.packages/core/src/embedding.ts publicly re-exports local-memory test seams _setAvailableMemoryForTest, _setConstrainedMemoryForTest, and _setContainerFreeForTest; pool seams _setEmbedPoolSizeForTest and _setPoolFreememForTest; and runtime lifecycle APIs including _resetProviderShutdownTrackingForTest, _saveAndClearProvider, _restoreProvider, _shutdownAndDisable, resetProvider, and shutdownProvider.search.embeddings.embedPoolSize or LORE_EMBED_POOL_SIZE; documented bounds are minimum 1 and maximum 8, default sizing is memory-gated to 1–2 workers, and each local worker loads its own approximately 137MB model.