Dashboard › opencode-lore › Distillation
9c2f0498-47d7-4fac-94ed-cb84864e0941["lore_tm_v1_DCRz4QxbYWqQoh6eA9hoXY9NMHlovZzwFhzlbKeFJWA","lore_tm_v1_-XYLV1PTX_zQrXVck7qeVJmwvW0BDyownP8sj1L24Rk","lore_tm_v1_c6vHHKYq92fG0cdxSR77DqDwtU7QTvI-v6pxcwP4TkU","lore_tm_v1_EAX1FvPJiMGjCx57qzsrk8Yh4aTrLjXlb9ReioidYRI","lore_tm_v1_4VBgMmifxRt55Zti0UiduIFtmQ2P3y1nerARnTXwUvE"]
Date: Sep 16, 2026
/proc/self/cgroup and /proc/self/mountinfo so a worker is never admitted from a stale cgroup directory or a cached discovery miss.memory.current, memory.high, and memory.max.packages/core/src/cgroup-memory.ts supports cgroup v1 and v2 memory discovery. On hybrid hosts it prefers the explicit v1 memory controller over the unified v2 hierarchy; direct mount matches are sorted by longest root, while a namespaced interpretation is accepted only when exactly one candidate exists.decodeProcPath() in packages/core/src/cgroup-memory.ts decodes octal procfs escapes, rejects paths that are not absolute, contain a NUL byte, or include a .. segment, then normalizes with posix.normalize().readLinuxCgroupMemoryHeadroomBytes() reads cgroup v2 usage from memory.current and limits from both memory.high and memory.max; for cgroup v1 it reads memory.usage_in_bytes and memory.limit_in_bytes. It walks from the process cgroup directory toward the mount point and returns the tightest finite nonnegative limit - usage headroom, or undefined when discovery or required reads are unsafe.packages/core/src/embedding/local.ts resolves available memory using process.constrainedMemory(), Linux cgroup headroom from readLinuxCgroupMemoryHeadroomBytes(), and—where supported—process.availableMemory(). Bun does not trust its runtime available-memory value because it currently aliases host freemem() inside constrained cgroups; Node’s libuv implementation is treated as process-limit-aware.lore:embedding_cap in kv_meta, storing cap, freeMemBytes, and optional positive knownBadCap; persistence is best-effort, and failures cause the cap to be re-derived on the next start.undefined, never NaN, and this must be testable without spinning up workers.MAX_WAITERS_PER_EMBED_OPERATION to 64.reconcileEmbedCap() must bound every return path by EMBED_TOKEN_CEILING, not only the model-derived path; knownBadCap is a hard persisted bound representing a cap that previously OOMed, and reprobe logic must never yield a cap above it even when given an above-ceiling input cap.EMBED_POOL_BUDGET_REF_TOKENS = 2048; comments identify an npm/WASM fixed 4 GiB heap constraint and a practical cap of at most 4962 tokens for that path.