Files
ruflo/.github
rUv 7c6362633e fix(memory): #2312 — break embedder-rescue recursion that OOM'd CI at 4GB (#2348)
Root cause (found by container bisection, not the suspected SONA/EWC chain):
memory-bridge's rescueAgentdbEmbedder (#2256-followup) monkey-patches
agentdb.embedder.embed to delegate to memory-initializer's generateEmbedding.
But generateEmbedding is bridge-FIRST — it calls bridgeGenerateEmbedding,
which calls registry.getAgentDB().embedder.embed — the patched function:

  generateEmbedding → bridgeGenerateEmbedding → embedder.embed (patched)
    → generateEmbedding → … unbounded async cycle

Microtask-driven, so no stack overflow — just monotonic heap growth to the
V8 limit (4050MB on the CI runner, SIGABRT 134, ~35s). The cycle only arms
when @xenova/transformers fails to init (pipeline=null → rescue applies),
which is why Linux CI died while Windows/macOS dev boxes never reproduced.
TEST 1 passed because the cycle needs the bridge registry initialized first
(post-task's bridgeRecordFeedback does that), which is also why the earlier
CLAUDE_FLOW_SKIP_RUVLLM_TRAJECTORY bypass had no effect — the allocator was
never in the ruvllm/SONA/EWC chain at all (bisection shows them flat at
122MB).

Fix:
- memory-initializer: extract generateLocalEmbedding (transformers/ruvector/
  hash chain, never the bridge). generateEmbedding now delegates to it after
  the bridge attempt — behavior unchanged for normal callers.
- memory-bridge rescue: delegate to generateLocalEmbedding (bridge-free
  leaf). If the import doesn't expose it (stale pairing), decline the rescue
  — fail safe, never recurse.
- Probe hardening: the old probe accepted any non-zero vector, which the
  deterministic hash fallback also satisfies — so it "rescued" agentdb's
  mock with our own mock. Now requires backend === 'onnx'. When declining
  because the local chain is also degraded, tag embedder.backend='mock' so
  bridgeGenerateEmbedding's AUDIT-#3 check stops labeling mock vectors as
  onnx.
- v3-ci.yml: drop continue-on-error from the graph-trajectory smoke — it
  gates again. Verified in a node:22-bookworm container (CI-equivalent
  fresh install + build): 10/10 pass at DEFAULT heap and at 512MB, cold and
  warm model cache. Pre-fix repro in the same container OOM'd in ~36s.
- smoke script: use pathToFileURL for dist imports so it runs on Windows
  (ERR_UNSUPPORTED_ESM_URL_SCHEME) — needed for local debugging of this.

Fixes #2312
2026-06-12 16:41:33 -04:00
..