Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(deps): #2048 β€” bump agentic-flow ^2.0.12 β†’ ^2.0.13 (Windows onnxruntime lazy-load)

ruv3dbf6074aa90
diff --git a/.github/supply-chain/accepted-findings.json b/.github/supply-chain/accepted-findings.json
index c43ba169ab..c8d42909cb 100644
--- a/.github/supply-chain/accepted-findings.json
+++ b/.github/supply-chain/accepted-findings.json
@@ -12,6 +12,11 @@
"date": "2026-05-19",
"commit": "ADR-124 β€” [email protected] upstream fix",
"summary": "Shipped [email protected] with @xenova/transformers moved from `dependencies` to `optionalDependencies` (upstream PR ruvnet/agentic-flow#154). Bumped agentic-flow ^2.0.11 β†’ ^2.0.12 in root + v3/@claude-flow/browser. Removed the previously-accepted CVE entry for agentic-flow β†’ @xenova/transformers β€” root npm audit now reports 0 vulnerabilities. End-user fresh-install with `npm install --omit=optional` skips @xenova/transformers entirely; default install still pulls it for users who need embeddings."
+ },
+ {
+ "date": "2026-05-19",
+ "commit": "ruflo#2048 β€” [email protected] lazy onnxruntime-node load",
+ "summary": "Shipped [email protected] to fix ruflo#2048 β€” `import('agentic-flow/reasoningbank')` on Windows crashed because router/providers/onnx-local.ts used a top-level `await import('onnxruntime-node')` which forced the native binding (`onnxruntime_binding.node`) to load at module import time. On Windows this throws \"OS cannot run %1\" even when VCRedist is installed. Upstream PR ruvnet/agentic-flow#155 moves the import into a lazy `loadOrt()` helper called from `initializeSession()`, so `reasoningbank` consumers never trigger the binding unless they actually run local ONNX inference. Bumped agentic-flow ^2.0.12 β†’ ^2.0.13 in root + v3/@claude-flow/browser. Acceptance test: `node -e \"import('agentic-flow/reasoningbank').then(()=>console.log('OK'))\"` now succeeds under both default install and `--omit=optional` (binding absent)."
}
],
"cve": [
diff --git a/.github/supply-chain/follow-ups.md b/.github/supply-chain/follow-ups.md
index 1e57c76c1b..4bb22b5e2d 100644
--- a/.github/supply-chain/follow-ups.md
+++ b/.github/supply-chain/follow-ups.md
@@ -20,29 +20,37 @@ Open issues that the supply-chain audit + recent CI hardening surfaced but requi
## #2048 β€” `agentic-flow/reasoningbank` ESM import fails on Windows (onnxruntime native binding)
-**Status**: HIGH-UX-impact, open. Tracked at https://github.com/ruvnet/ruflo/issues/2048.
+**Status**: FIXED upstream + downstream integrated. Tracked at https://github.com/ruvnet/ruflo/issues/2048.
-**Root cause**: `import('agentic-flow/reasoningbank')` triggers an eager load of `onnxruntime-node`'s native binding (`onnxruntime_binding.node`), which fails on Windows with "OS cannot run %1" even when the user has VCRedist + a working CJS `require('onnxruntime-node')` from the same directory. The static import in some part of the reasoningbank module graph forces the binding load before any user code runs.
+**Root cause**: `import('agentic-flow/reasoningbank')` triggered an eager load of `onnxruntime-node`'s native binding (`onnxruntime_binding.node`), which fails on Windows with "OS cannot run %1" even when the user has VCRedist installed. The chain was `reasoningbank/index.ts β†’ core/distill.ts β†’ router/router.ts β†’ onnx-local.ts (top-level await)`. The top-level `await import('onnxruntime-node')` in `onnx-local.ts` forced the binding load at module-evaluation time, before any user code ran.
-**Pattern is identical to ADR-124** β€” which moved `@xenova/transformers` from agentic-flow's `dependencies` to `optionalDependencies` and converted the one eager static import to dynamic. The same shape of fix is needed for `onnxruntime-node` in `agentic-flow/src/reasoningbank/**`.
+**Upstream fix** (PR ruvnet/agentic-flow#155, shipped as [email protected]):
-**Right fix** (upstream patch in `ruvnet/agentic-flow`):
+1. βœ… `src/router/providers/onnx-local.ts` β€” moved the top-level `await import('onnxruntime-node')` into a lazy `loadOrt()` helper called from `initializeSession()`. The binding now loads only when an explicit inference call happens, never at module import time.
+2. βœ… `src/router/providers/onnx-local-optimized.ts` β€” removed the eager top-level try/catch around `await import('onnxruntime-node')`. It was dead code (the class extends ONNXLocalProvider and never used `ort` directly), but it was still triggering the binding at import time.
+3. βœ… `onnxruntime-node` was already in `optionalDependencies` per 2.0.12 β€” no `package.json` change needed for this fix.
-1. Audit `agentic-flow/src/reasoningbank/**` for any static `import { ... } from 'onnxruntime-node'`. The 6 known callers in `src/embeddings/**`, `src/core/**`, `src/services/**`, `src/router/providers/onnx.ts`, and `src/utils/model-cache.ts` mostly use dynamic import already (ADR-124 left the pattern in place). The reasoningbank-specific surface needs the same audit.
-2. Move `onnxruntime-node` from `dependencies` to `optionalDependencies` in `agentic-flow/package.json` (it's already in `optionalDependencies` per 2.0.12 β€” confirm reasoningbank doesn't transitively force-load it).
-3. Wrap each remaining static binding in try/catch with a clear `npm install onnxruntime-node` warning + a hash-based fallback (the same fallback path the `embeddings.ts` patch in ADR-124 ships).
-4. Cut `[email protected]` (patch) and bump `v3/@claude-flow/browser` + root.
+**Downstream integration** (this PR):
-**Interim workaround for users**:
+- Bumped `agentic-flow` ^2.0.12 β†’ ^2.0.13 in root `package.json` and `v3/@claude-flow/browser/package.json`.
+- Regenerated root `package-lock.json`, `v3/@claude-flow/browser/package-lock.json` (npm `--no-workspaces`), and `v3/pnpm-lock.yaml`.
+
+**Acceptance test** (verified locally on 2.0.13):
```bash
-npm install ruflo --omit=optional # Windows: skip the native binding entirely
-# or
-npm install ruflo && set ONNXRUNTIME_DISABLE=1 # disable at runtime
+# Full install β€” binding present, but never loaded at module import
+npm install [email protected]
+node -e "import('agentic-flow/reasoningbank').then(()=>console.log('OK'))" # β†’ OK
+node -e "import('agentic-flow/router').then(()=>console.log('OK'))" # β†’ OK
+
+# Simulated Windows: --omit=optional skips the binding entirely
+npm install [email protected] --omit=optional
+node -e "import('agentic-flow/router').then(()=>console.log('OK'))" # β†’ OK (was: FAIL)
```
-**CI guard** to add after the upstream patch lands:
-- Windows runner smoke job that does `node -e "import('agentic-flow/reasoningbank').then(() => console.log('OK'))"` under `--omit=optional` and asserts it loads without the binding present.
-- That smoke goes in the supply-chain audit suite alongside the other 5 layers.
+**Follow-up CI guard** (now possible):
+- Add a Windows-runner smoke job that does `node -e "import('agentic-flow/reasoningbank').then(()=>console.log('OK'))"` under `--omit=optional` to lock the lazy-load contract in place. Add to `v3-ci.yml` alongside the existing supply-chain audit jobs.
+
+**Related**: `--omit=optional` surfaced a separate import (agentdb static import via reasoningbank graph). That's NOT #2048 (which was specifically the Windows native binding crash with the binding present). Tracking separately if it becomes user-facing.
## #2049 β€” `kg-extract` over-counts type imports + `kg-traverse` mis-wired
diff --git a/package-lock.json b/package-lock.json
index 16e4f05d8b..39853b4ad6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,6 +15,7 @@
"@claude-flow/shared": "^3.0.0-alpha.7",
"@noble/ed25519": "^2.1.0",
"@ruvector/rabitq-wasm": "^0.1.0",
+ "agentic-flow": "^2.0.13",
"semver": "^7.6.0",
"zod": "^3.22.4"
},
@@ -46,7 +47,7 @@
"@ruvector/router-linux-x64-gnu": "^0.1.30",
"@ruvector/sona": "^0.1.5",
"agentdb": "^3.0.0-alpha.14",
- "agentic-flow": "^2.0.12"
+ "agentic-flow": "^2.0.13"
}
},
"node_modules/@anthropic-ai/claude-agent-sdk": {
@@ -4259,9 +4260,9 @@
"license": "MIT"
},
"node_modules/agentic-flow": {
- "version": "2.0.12",
- "resolved": "https://registry.npmjs.org/agentic-flow/-/agentic-flow-2.0.12.tgz",
- "integrity": "sha512-F0b9TyT77hbec2A86+AiWa+4qctof5t5qqfbwbunqi7TWLwXOtE8lzI1TdpPBkzLKrLcGQXyeuwAwe18Hs+dYA==",
+ "version": "2.0.13",
+ "resolved": "https://registry.npmjs.org/agentic-flow/-/agentic-flow-2.0.13.tgz",
+ "integrity": "sha512-VN3OVYUweVtCE4ARzxwf0Qf22Z3+6dgYWukKvnE5qlBIa5FEPjD5rRN4Fz5mecQ+88+0fnFgJ/00lb6MVhWsNQ==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
diff --git a/package.json b/package.json
index 9987d9cf99..765ce7c128 100644
--- a/package.json
+++ b/package.json
@@ -72,7 +72,7 @@
"@ruvector/router-linux-x64-gnu": "^0.1.30",
"@ruvector/sona": "^0.1.5",
"agentdb": "^3.0.0-alpha.14",
- "agentic-flow": "^2.0.12"
+ "agentic-flow": "^2.0.13"
},
"overrides": {
"hono": ">=4.11.4",
diff --git a/v3/@claude-flow/browser/package-lock.json b/v3/@claude-flow/browser/package-lock.json
index 9667b84523..511711324b 100644
--- a/v3/@claude-flow/browser/package-lock.json
+++ b/v3/@claude-flow/browser/package-lock.json
@@ -11,7 +11,7 @@
"license": "MIT",
"dependencies": {
"agent-browser": "^0.27.0",
- "agentic-flow": "^2.0.12",
+ "agentic-flow": "^2.0.13",
"zod": "^3.22.4"
},
"devDependencies": {
@@ -3087,9 +3087,9 @@
}
},
"node_modules/agentic-flow": {
- "version": "2.0.12",
- "resolved": "https://registry.npmjs.org/agentic-flow/-/agentic-flow-2.0.12.tgz",
- "integrity": "sha512-F0b9TyT77hbec2A86+AiWa+4qctof5t5qqfbwbunqi7TWLwXOtE8lzI1TdpPBkzLKrLcGQXyeuwAwe18Hs+dYA==",
+ "version": "2.0.13",
+ "resolved": "https://registry.npmjs.org/agentic-flow/-/agentic-flow-2.0.13.tgz",
+ "integrity": "sha512-VN3OVYUweVtCE4ARzxwf0Qf22Z3+6dgYWukKvnE5qlBIa5FEPjD5rRN4Fz5mecQ+88+0fnFgJ/00lb6MVhWsNQ==",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
diff --git a/v3/@claude-flow/browser/package.json b/v3/@claude-flow/browser/package.json
index d64767dd58..9276825f19 100644
--- a/v3/@claude-flow/browser/package.json
+++ b/v3/@claude-flow/browser/package.json
@@ -23,7 +23,7 @@
},
"dependencies": {
"agent-browser": "^0.27.0",
- "agentic-flow": "^2.0.12",
+ "agentic-flow": "^2.0.13",
"zod": "^3.22.4"
},
"overrides": {
diff --git a/v3/pnpm-lock.yaml b/v3/pnpm-lock.yaml
index 3d1d409a3e..6f40f40eb1 100644
--- a/v3/pnpm-lock.yaml
+++ b/v3/pnpm-lock.yaml
@@ -57,8 +57,8 @@ importers:
specifier: ^0.27.0
version: 0.27.0
agentic-flow:
- specifier: ^2.0.12
- version: 2.0.12(@types/[email protected])
+ specifier: ^2.0.13
+ version: 2.0.13(@types/[email protected])
zod:
specifier: ^3.22.4
version: 3.25.76
@@ -6753,8 +6753,8 @@ packages:
- utf-8-validate
dev: false
- resolution: {integrity: sha512-F0b9TyT77hbec2A86+AiWa+4qctof5t5qqfbwbunqi7TWLwXOtE8lzI1TdpPBkzLKrLcGQXyeuwAwe18Hs+dYA==}
+ resolution: {integrity: sha512-pp36lAT7lXF9cyXA7KqUBe8pg7nUrGrhb3hplzTJ1V2B6y7n+jBG8/wH1gTNWk+i1+Zzzgl2zfngmY9u2qEOFg==}
engines: {node: '>=18.0.0'}
hasBin: true
requiresBuild: true
@@ -6768,6 +6768,7 @@ packages:
'@ruvector/ruvllm': 0.2.4
'@ruvector/tiny-dancer': 0.1.18
'@supabase/supabase-js': 2.89.0
+ '@xenova/transformers': 2.17.2
axios: 1.13.2
dotenv: 16.6.1
express: 5.2.1
@@ -6786,7 +6787,6 @@ packages:
'@rollup/rollup-darwin-arm64': 4.60.3
'@ruvector/attention': 0.1.32
'@ruvector/sona': 0.1.6
- '@xenova/transformers': 2.17.2
agentdb: 3.0.0-alpha.14(@types/[email protected])([email protected])
better-sqlite3: 11.10.0
onnxruntime-node: 1.24.3
@@ -6808,10 +6808,9 @@ packages:
- supports-color
- sury
- utf-8-validate
- dev: false
- resolution: {integrity: sha512-pp36lAT7lXF9cyXA7KqUBe8pg7nUrGrhb3hplzTJ1V2B6y7n+jBG8/wH1gTNWk+i1+Zzzgl2zfngmY9u2qEOFg==}
+ resolution: {integrity: sha512-VN3OVYUweVtCE4ARzxwf0Qf22Z3+6dgYWukKvnE5qlBIa5FEPjD5rRN4Fz5mecQ+88+0fnFgJ/00lb6MVhWsNQ==}
engines: {node: '>=18.0.0'}
hasBin: true
requiresBuild: true
@@ -6825,7 +6824,6 @@ packages:
'@ruvector/ruvllm': 0.2.4
'@ruvector/tiny-dancer': 0.1.18
'@supabase/supabase-js': 2.89.0
- '@xenova/transformers': 2.17.2
axios: 1.13.2
dotenv: 16.6.1
express: 5.2.1
@@ -6844,6 +6842,7 @@ packages:
'@rollup/rollup-darwin-arm64': 4.60.3
'@ruvector/attention': 0.1.32
'@ruvector/sona': 0.1.6
+ '@xenova/transformers': 2.17.2
agentdb: 3.0.0-alpha.14(@types/[email protected])([email protected])
better-sqlite3: 11.10.0
onnxruntime-node: 1.24.3
@@ -6865,6 +6864,7 @@ packages:
- supports-color
- sury
- utf-8-validate
+ dev: false
resolution: {integrity: sha512-yqrcwWG+RztVKx4w9bvIiAymXEZn93GiTsF6qhYv2gOTQyhIl+VKwY9MLuQKz+Nr5wibTJ4EPm1Cib43usvNNA==}