Dashboard › opencode-lore › Distillation
9078036d-d459-4d64-9302-433aa9aab056["lore_tm_v1_ElglWksJ_5-4pCgMRd47YIby31Q6wm4zqnLy6Bbexho","lore_tm_v1_nTWHMcoJ6TKck-00H-tGUjQ4xZdn5vuEAJj4qJPmDqo","lore_tm_v1_yjeXXnOHoYjuT23PpuEA13sUVbid_2DlFlmWNP-N8Dg","lore_tm_v1_hT3vhisF_c2TkFpbErywISdQ0HZpgsZPrP9oYVhMLDk","lore_tm_v1_Jpx7iBTC6l5OKq37fy98rmfnGStzJUN-Kb0ldIdoovI","lore_tm_v1_w2ETIjEh-h0e5iCDeCZldThihGomfbDR4FJNnlruLDM","lore_tm_v1_gvSOO3qHw8R2wk6DDVd-VYLvg_KyL-Jxk3v-nASmrxM","lore_tm_v1__qbXSSgnTmio4JipPRou_Xv9Wfn9o6haG17hAn-bjbo","lore_tm_v1_o-0wYSH38Q885lkBcbOta9m67sdF_jaoDhD1emAF3fw","lore_tm_v1_LJsOTTyKTGNzkmMm_Ym3DRZD_w-C8T2xROKmKI68iIE","lore_tm_v1_-sSL0s4RBzKfYSJLBie9eSEea3_4p-wVZRSUqV41dDY"]
Date: Sep 16, 2026
×0.7 backoff never fires; the only defense is never over-allocating in the first place.free / ceiling; 2. the cap is re-clamped to current free memory on every request, not only at construction.packages/core/test/embedding-pool-memory.test.ts contains 4 end-to-end OOM regressions: 1. with a pool ceiling of 2 and 6 * GB free, each worker’s maxTokens must equal memoryModelEmbedCap((6 * GB) / 2) and be below the undivided cap; 2. with a constrained 12 * GB limit but Number.NaN available memory, the primary worker must use MIN_EMBED_TOKENS; 3. with ceiling 1, the same worker must re-clamp from memoryModelEmbedCap(6 * GB) to memoryModelEmbedCap(2 * GB) after free memory drops—the pool never grew because its ceiling was 1; 4. after EMBED_OOM_EXIT_CODE, a respawned worker must resubmit the same request ID at memoryModelEmbedCap(2 * GB), below backoffEmbedCap(first.maxTokens).packages/core/src/cgroup-memory.ts, cgroup membership and mount discovery are re-read from /proc/self/cgroup and /proc/self/mountinfo on every call so a worker is never admitted from a stale cgroup directory or a cached discovery miss.resolveLinuxCgroupMemoryFiles() prefers an explicit cgroup v1 memory-controller membership over a unified cgroup v2 membership on hybrid hosts; it selects the longest matching direct mount root and accepts a namespaced interpretation only when exactly one candidate exists.decodeProcPath() decodes octal procfs escapes, rejects paths that are not absolute, contain \0, or include a .. segment, and normalizes accepted paths with posix.normalize().readLinuxCgroupMemoryHeadroomBytes() traverses from the process cgroup directory to the cgroup mount point and takes the minimum finite limit - usage headroom across boundaries. Every descendant boundary must be readable so sibling usage is never subtracted from the wrong scope; only a cgroup v2 root mount with root === "/" may omit its own memory files.NaN or Infinity; clampEmbedCap(Number.NaN) must equal MIN_EMBED_TOKENS.packages/core/test/embedding-cap.test.ts specifies resolveMemoryHeadroom() behavior: choose the tighter Linux or Node headroom; honor a Linux soft-only boundary when the hard limit is 0; use libuv headroom on constrained non-Linux Node; return undefined for constrained Bun without trustworthy usage; and never invent headroom on an unconstrained host.clampFreeToContainerLimit() contract in packages/core/test/embedding-cap.test.ts: unconstrained (<= 0) or invalid/negative limits leave host free memory unchanged; constrained headroom clamps host free memory; a finite constrained limit with missing or Number.NaN usage fails closed to 0; discovered headroom is honored even with an unlimited hard limit; and the result may never exceed the original host-free figure.PER_WORKER_MEM_BUDGET_BYTES === EMBED_WORKER_RESIDENT_RESERVE_BYTES === 1536 * MB; desiredEmbedPoolSize(3 * GB - 1) must be 1, while desiredEmbedPoolSize(3 * GB) must be 2.packages/core/test/embedding-pool.test.ts includes a burst-growth regression where _setEmbedPoolSizeForTest(4), constrained memory is 12 * GB, and available headroom is 1600 * 1024 * 1024; three concurrent requests may create only 2 workers because an admitted but not-yet-initialized worker’s budget must be reserved and not spent again.0 despite ceiling 2; 2. host free reports 64 * GB but the cgroup limit is 256 * 1024 * 1024; 3. host free reports 64 * GB, constrained memory is 12 * GB, and current cgroup headroom is only 23 * 1024 * 1024.64 * GB free memory permits the default ceiling of 2 workers; 0 headroom keeps the pool at one worker; and a pool constructed under 0 headroom must later grow to 2 workers when headroom rises to 64 * GB.