Commit ee57e2b
committed
fix(embedding): resolve race condition vulnerabilities in dimension detection
- Add Promise-based dimension detection caching in both OpenAI and Ollama providers
- Prevent concurrent embed/embedBatch calls from triggering multiple API requests
- Implement race condition-safe ensureDimensionDetected() methods
- Fix state management in setModel() to properly reset all detection flags
- Maintain backward compatibility with existing API interfaces
- Addresses performance and reliability issues identified in zen audit1 parent 9dbdf45 commit ee57e2b
File tree
5 files changed
+9582
-38
lines changed- packages/core
- src/embedding
5 files changed
+9582
-38
lines changed
0 commit comments