fix: correct Node.js version references from 24 to 22 in comments and code

Fixed confusing messaging where comments mentioned Node 24 while actual requirement is Node 22:

- environment.ts: Fixed areWorkerThreadsAvailableSync() to check for >= 22 instead of >= 24
- workerUtils.ts: Updated comments to reference Node.js 22 LTS instead of 24
- embedding.ts: Updated ONNX threading comment to reference Node.js 22 LTS

Why Node 22 not Node 24:
- ONNX Runtime has stability issues in Node 24 (V8 HandleScope crashes)
- Node 22 LTS provides maximum stability with our embedding model
- These stale Node 24 references were causing user confusion

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
David Snelling 2025-10-20 11:43:31 -07:00
parent fcf710c398
commit 22513ffcb4
3 changed files with 5 additions and 5 deletions

View file

@ -14,7 +14,7 @@ import { pipeline, env } from '@huggingface/transformers'
if (typeof process !== 'undefined' && process.env) {
process.env.ORT_DISABLE_MEMORY_ARENA = '1'
process.env.ORT_DISABLE_MEMORY_PATTERN = '1'
// Force single-threaded operation for maximum stability (Node.js 24 compatibility)
// Force single-threaded operation for maximum stability (Node.js 22 LTS)
process.env.ORT_INTRA_OP_NUM_THREADS = '1' // Single thread for operators
process.env.ORT_INTER_OP_NUM_THREADS = '1' // Single thread for sessions
process.env.ORT_NUM_THREADS = '1' // Additional safety override