Dashboardopencode-loreEmbedding WASM cap reprobe

Embedding WASM cap reprobe

Category: gotcha
Confidence: 1.00
ID: 01a0af08-1801-71b2-9e70-da025f94cb18
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 0
Source session: 1JmtIdaVnn5PTPdxS
Created: 2026-09-15 12:01:23
Updated: 2026-09-17 11:02:18

Content

Trap: lowering a cap in the existing worker looks sufficient, but WASM memory never shrinks; remembering the highest failed cap or letting stale sibling providers overwrite persistence can also re-admit a proven-bad size. Fix: respawn with a fresh heap for every downward change, retain the lowest positive failed cap as a shared atomic hard ceiling (knownBad - 1), and clamp after all upward logic. Backoff and non-finite inputs must stay within [MIN_EMBED_TOKENS, MODEL_MAX_TOKENS]; upward probes may reuse a worker but never reach the WASM ceiling or known-bad cap. Compare persisted and startup memory in consistent total/per-worker units, storing the divisor when needed.

Move to: