Skip to content

Commit 1200b90

Browse files
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 audit
1 parent aad1b56 commit 1200b90

File tree

5 files changed

+9581
-37
lines changed

5 files changed

+9581
-37
lines changed

0 commit comments

Comments
 (0)