Dashboard › opencode-lore › Embedding runtime safety, validation, c…
01a0a4f0-8f8a-764a-9550-561fec70032aBefore replacing any embedding worker, keep retirement owned and count active plus retiring workers against capacity. Starting replacements immediately looks responsive but can overlap model sessions and multiply memory; wait for confirmed exit, except native→WASM fallback may briefly overlap while its superseded worker remains tracked. Cooperative shutdown escalates to terminate() after 1.5 seconds and must confirm termination; otherwise latch unavailable. Validate each embed result as one finite configured-width Float32Array per input, then L2-normalize. Never purge vendored models; purge only proven-corrupt external downloads.