Dashboard › opencode-lore › Distillation
e6f9d970-ec5f-4bc6-9a23-ec4fb8018dd7["lore_tm_v1_Se14UIcVojNsHoZQ_mJFHmpQQH2Ekv3rXGy3vquzjNc","lore_tm_v1_u0jrqifM2ef6deJ_o26wBE5fAmN1TjtR5JbS-x12vkI","lore_tm_v1_gPrLBX7t_oHd7u6iPCZMZi7OhQJSou9OxKKE8n-Q_e0","lore_tm_v1_w63CcM4XMlFCx3hVXqQ3HJqDmerdO260s2HAUkrut8E","lore_tm_v1_FOle-Qpntfz7lS0ucyIW4XArY6iIr7v3HtMNKFVUEjY","lore_tm_v1_0Tx2XKqvHQIbPwAnLZqMmRapaCh3NHMj5hKHXWwNXEs","lore_tm_v1_wfxda8R_7LzvA1ARXobGMPRw7CfhMzMBn65sFoAj-Ag","lore_tm_v1_VXRQ-ShUqSN_Iym_rqomHMR7SmXPh0nnrBkUEJho_os","lore_tm_v1_bGYo66ai_fQ2TM00h0BeOdsuKVjQTZB1p10AkgJ7Tp0","lore_tm_v1_AsrryYMHUCe5Mw5o97NkaZe9ShLOETIXCDndlCrFZG0","lore_tm_v1_O9G83SXVP_4hjyXUB4DjtMPGWYNG85ffnYW_ZglnJNE","lore_tm_v1_8hGqMyt7_ZVvPE3XXa7ezv7xIjdYeNWIEpLizz8Lr_w","lore_tm_v1_LrRBxUlirpgN-mmR2lje8gliNqbymP6lCY3O0dTnSMI","lore_tm_v1_VdZYsliCov3CyQqH3nWrcHxNLrcNon6E3asBZqLwNz8","lore_tm_v1_Dv2Yx_DLAI9lByvCEb2CIVYskzhLoy444KGjZOMhTzI","lore_tm_v1_1lPfXDQRRUDyHDRNAK5ZcuP0QEv-1u8eDB6HeDnKZis","lore_tm_v1_VU_rb04rKw0nztDIoRIqioqHUEwDS7_BTSkN5p69iCU","lore_tm_v1_TDRlVVeGAeHEz6fEH4MAehkXAJRAXS7xRcNL9_DaS78","lore_tm_v1_AZcsjLsgvUF8pckQQaYpgkRa1V9Fig2nzLWgZcVMaCg","lore_tm_v1_edfSSyRUFr3XXh9eeSfagjWgXpfvY1okMLaBKZEKoWY","lore_tm_v1_lOwdksFXybakCClIjWAKpWU-3ufNJWbgS4IbRazDbc4","lore_tm_v1_1ITaNX8eH0ogcoIGv7T5yz1Q7OnELdbSE6aHUgZgou4"]
Date: Sep 17, 2026
packages/core/test/embedding-pool.test.ts exercises cross-worker dispatch via _setTestWorkerFactory, including least-busy routing, lazy/memory-gated growth, the broken-provider latch, and pool shutdown; the per-worker OOM/self-heal lifecycle belongs exclusively in packages/core/test/embedding-oom-recovery.test.ts, and embedding-pool.test.ts never touches it.LocalProviderUnavailableError, retaining EmbeddingWorkerWatchdogError with stage: "init" as the cause.os.freemem() reports 64 GiB but the cgroup cap is 256 MiB; this prevents a second native-ONNX worker from exceeding memory.max and being SIGKILLed, as occurred in Adityaβs Railway container.settle<T>() helper in packages/core/test/embedding-pool.test.ts attaches fulfillment and rejection handlers immediately so expected rejections are never flagged as "unhandled".packages/core/test/embedding-cap-persistence.test.ts: _readPersistedEmbedCap() returns null when absent, corrupt, or missing required fields; _persistEmbedCap() round-trips cap and positive freeMemBytes, overwrites via ON CONFLICT, preserves positive knownBadCap, and omits/ignores knownBadCap when 0, undefined, non-positive, or non-numeric. Persistence key is lore:embedding_cap.packages/core/test/embedding-oom-recovery.test.ts exclusively exercises the stateful LocalProvider OOM lifecycle: worker "exit" with EMBED_OOM_EXIT_CODE β handleOomBackoff β resubmitPending, including the token-floor latch and synchronous respawn failure.backoffEmbedCap(EMBED_TOKEN_CEILING), persists the lowered cap, spawns a fresh worker, and resubmits the same in-flight request ID; an OOM at MIN_EMBED_TOKENS does not respawn, rejects with LocalProviderUnavailableError, and latches the provider into FTS-only mode.MIN_EMBED_TOKENS before latching, and a synchronous failure on the second worker spawn must reject pending requests rather than leave them unsettled.workerData.stderrSilenced on every spawn because worker threads have separate globalThis; otherwise the workerβs [lore] OOM line can corrupt the host TUI.settle<T>() in packages/core/test/embedding-oom-recovery.test.ts attaches handlers immediately so a rejection occurring while worker events are driven is never flagged as "unhandled".healthy in packages/core/src/embedding/pool.ts at lines 84, 308, and 551: the slot field is declared, initialized to false, and later set to true.packages/core/src/embedding/local.ts: persistEmbedCap at line 139, _persistEmbedCap at line 177, delegation at line 182, and production persistence at lines 791 and 857.embedInTokenBatches with MAX_BATCH_TOKEN_AREA = 4096; temporal chunks are capped at 64 by retaining chunks 0..62 and joining index 63+ into one final tail, and storeTemporalChunks is called once."\n\x1f" boundaries and a 64-chunk temporal cap were chosen over splitting on tool-looking text, dropping overflow, or allowing unlimited vec0 rows because tool output may imitate headers and unbounded fan-out expands storage and KNN widening; units remain dependency-free, prose/reasoning is preserved verbatim, reduced tool envelopes are retained, and vectors are stored atomically.resume() and no payload-observing "data" listeners, rather than logging sanitized or rate-limited lines, because native dependencies can emit model paths, provider diagnostics, IDs, and process state while every core log reaches persistent storage and LogSink; only fixed categorical lifecycle messages are retained.680 MB and host freemem() overstates capacity in constrained containers; worker 0 remains available, extra workers require concurrent demand plus clampFreeToContainerLimit(...) headroom, memDivisor shares the budget, and upward re-probes must never reach a prior OOM ceiling.availableParallelism() limits are used only when below cpus().length; always setting ONNX Runtime threads to the logical CPU count was rejected because native ORT is cgroup-blind and may create host-core-sized pools in a 1-vCPU container, wasting RSS and causing context-switch thrash. Unconstrained hosts return undefined, preserving ORTβs physical-core default instead of raising it to the hyper-thread count."document" input type, so it never self-gates against the recall-load predicate."query" embeds; write-time and backfill "document" embeds are excluded, admission reads the live counter rather than a snapshot, and provider disappearance, OOM, timeout, or rejection releases ownership in finally."document" embeds must not be used for embedding-pool concurrency or memory-cap fixtures because production document work is intentionally serialized and one unresolved request can leak admission into later tests; fixtures requiring simultaneous provider calls use single-text "query" embeds, while dedicated scheduler tests cover document serialization.resolveReadMode() must trust physical storage layout over vec.storage_mode; committed vec0 and the connection latch override forged "blob" metadata, transaction-local provisional state remains rollback-safe, and blob fallback is allowed only after proving base embedding columns exist.checkConfigChange() before the provider-availability return and before maybeCutoverToVec0(); otherwise unavailable embeddings can skip physical vec0 repair, while reversing cutover order can seed vec0 from stale blobs.v4.1.8 passed 2 test files and all 13 tests in 2.89 seconds.tmzmtlss / commit 6a5b70c9 on fix/embedding-runtime-admission had description fix(core): correct embedding runtime selection and admission, parent 2cbf4006 on main, no revision conflict, and a conflicting bookmark named fix/responses-private-references.packages/core/src/cgroup-memory.ts and packages/core/test/cgroup-memory.test.ts; modified packages/core/src/embedding/local.ts, packages/core/src/embedding/pool.ts, packages/core/src/embedding-cap.ts, packages/core/src/embedding-worker-types.ts, packages/core/src/embedding-worker.ts, packages/core/src/embedding.ts, packages/core/src/ort-native.ts, packages/core/test/embedding-cap.test.ts, packages/core/test/embedding-pool-memory.test.ts, packages/core/test/embedding-pool.test.ts, packages/core/test/embedding-wasm-fallback.test.ts, packages/core/test/embedding-worker-stdio.test.ts, packages/core/test/embedding-worker-types.test.ts, packages/core/test/ort-native.test.ts, packages/gateway/script/bundle.ts, packages/gateway/script/ort-platform-package.ts, packages/gateway/test/bundle-exports.test.ts, and packages/gateway/test/ort-platform-package.test.ts.ab8a298011cb88a89aa2ac41f70ad718afc296605e867007d1c298f679f43b5f; a later scoped patch SHA-256 was a781cff720fd7624addc687a1830db1cbebde9153c10bd961dc08ecbe374b9f7.packages/core/test/embedding-cap.test.ts:102 expected resolveMemoryHeadroom(0, undefined, 7 * GB) to equal 7516192768 but received undefined; packages/core/test/embedding-pool-memory.test.ts:176 expected MIN_EMBED_TOKENS (256) but received 4948 when cgroup accounting failed without a hard limit.tmzmtlss at 6a5b70c9ee77, parent 2cbf40060c67, and stated no files or VCS state were mutated.constrainedMemoryLimit() uses 0 for both unconstrained and unknown states in packages/core/src/embedding/local.ts:86-97, clampFreeToContainerLimit() returns hostFree without a finite hard limit/headroom in packages/core/src/embedding-cap.ts:165-173, and packages/core/src/embedding/pool.ts:282-287 blocks unknown headroom only when constrained > 0. Evidence: packages/core/test/embedding-pool-memory.test.ts:164-176 expected 256 but got 4948. Recommended fix: return a tagged known, known-unconstrained, or unknown sample; only explicit unconstrained state may use host memory, while unknown becomes zero headroom; add a pool-growth regression for unknown soft-limit accounting.packages/core/src/embedding/pool.ts:290-315 and :550-575, but never become unhealthy again; growth reserves only for !slot.healthy at :262-269; an OOM replaces the worker internally at packages/core/src/embedding/local.ts:720-727 and :876-919 without notifying the pool, so temporarily increased sampled headroom can admit another pool slot while the replacement model reloads. Recommended fix: track current worker-generation residency separately from historical health, reserve a full model budget from exit until the replacement completes a real embed, and add an OOM-replacement-plus-concurrent-growth regression.reprobeEmbedCap() applies Math.max(cap, β¦) after calculating the known-bad ceiling at packages/core/src/embedding-cap.ts:354-365, making reprobeEmbedCap(3000, 64 * GB, 2400) === 3000; handleOomBackoff() uses Math.max(this.lastOomCap, capBefore) at packages/core/src/embedding/local.ts:845-857, so failures at 4000 then 2800 remember 4000 and may re-probe to the failed 2800; each provider snapshots knownBadCap once at local.ts:468-475 and unconditionally overwrites shared persistence at :139-155 and :782-791, allowing stale siblings to erase tighter learned limits. Recommended fix: keep the lowest positive failed cap in shared pool/process state, atomically merge it into persistence, apply it as a final clamp even when lowering the current cap, and test repeated descending OOMs plus two stale sibling providers.containerFreeBytes() samples the limit and then availableMemoryHeadroom() samples it again at packages/core/src/embedding/local.ts:99-136; the pool repeats this at packages/core/src/embedding/pool.ts:282-287. A first sample of 0, second finite sample, and failed scoped-headroom read can yield (hostFree, 0, undefined) and fail open; constructor sampling at local.ts:472-475 can also anchor a low initial cap to a high re-probe baseline. Recommended fix: use one immutable memory snapshot per admission decision and one initial sample for both cap and baseline; add a sequence-driven limit-change regression.clampFreeToContainerLimit() at packages/core/src/embedding-cap.ts:160-173 does not validate hostFree, so positive infinity can admit workers to the pool ceiling; backoffEmbedCap() at embedding-cap.ts:256-259 can return Infinity or NaN; persisted values at packages/core/src/embedding/local.ts:53-64 only receive typeof number checks, and JSON 1e309 parses as infinity. Recommended fix: normalize non-finite or negative memory/cap inputs to a safe floor or zero before arithmetic and add table tests for NaN, both infinities, negative values, and production pool growth.memDivisor before reconciliation at packages/core/src/embedding/local.ts:160-170, while persistence at :782-791 and :845-857 and the in-process baseline at :475 use undivided memory; with pool ceiling 2, unchanged total memory appears halved after restart and doubled total memory appears unchanged. Recommended fix: persist the divisor with the learned cap, or compare total memory with total memory while deriving per-worker model cap; test restarts across pool-ceiling changes.embedding-cap.test.ts:102, embedding-pool-memory.test.ts:176), while OOM recovery and persistence suites passed all 13 tests but lacked coverage for lower repeated failures and stale sibling writers.AGENTS.md, quality/REVIEW.md, and package.json because the required repo-setup skill was unavailable.