Dashboardopencode-loreMake native ONNX Runtime resolution fai…

Make native ONNX Runtime resolution fail closed to WASM

Category: preference
Confidence: 0.80
ID: 01a0aee0-8275-7f22-aa11-4f79fdd756c9
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 0
Source session: 1JmtIdaVnn5PTPdxS
Created: 2026-09-17 10:19:04
Updated: 2026-09-17 10:19:04

Content

Always treat native ONNX Runtime as an optional optimization whose discovery or loading failures must never crash or interrupt embedding. Resolver functions must catch all errors and return null when packages are absent, invalid, unsupported, or unresolvable, allowing the WASM fallback to proceed. Search only the worker package’s own declared dependencies and node_modules; never select an arbitrary ancestor or unrelated onnxruntime-node installation. Validate package metadata, canonical paths, containment, and platform binary signatures before use. Preserve ONNX Runtime’s default thread configuration on unrestricted hosts, applying an intra-op override only when availableParallelism() is genuinely lower than os.cpus().length.

Move to: