Files
oh-my-pi/packages/coding-agent/test
roboomp 65782a75e6 fix(mnemopi): carry (model, cacheDir) on every embed for respawn safety
After `shutdownMnemopiEmbedClient()` clears `#worker` (session dispose, or
worker crash), mnemopi still holds the cached `LocalEmbeddingModel` wrapper.
The next embed re-spawned a fresh subprocess that had never received
`init`, and the bare `embed` request tripped the "embed before init" guard,
breaking local embeddings for the rest of the process.

- Carry `model` + `cacheDir` in every `embed` IPC; bind both into the
  `MnemopiSubprocessEmbeddingModel` closure when the wrapper is created.
- Worker calls `ensureLoaded(model, cacheDir)` in `handleEmbed` (idempotent
  for the same key, so steady-state embeds pay nothing). Drops the
  "embed before init" guard — `embed` self-initializes.
- Promotes the internal `WorkerHandle` interface to `MnemopiEmbedWorkerHandle`
  so the test seam can construct a fake worker.
- New regression test drives a fake worker, terminates + re-embeds the SAME
  cached wrapper, and asserts every embed message still carries the bound
  `(model, cacheDir)`.

Per review on #3034.
2026-06-19 08:20:14 +00:00
..
2026-06-18 05:12:25 +02:00
2026-06-14 17:32:28 +02:00
2026-06-13 16:48:41 +02:00
2026-06-11 21:03:49 +02:00
2026-05-30 18:08:51 +02:00
2026-05-30 18:08:51 +02:00
2026-06-12 11:24:26 +02:00
2026-05-30 18:08:51 +02:00