Problem
Two related problems in the embedding system:
1. Cache key bug
clawhive-memory/src/embedding.rs:547 hardcodes let provider = "openai" as cache key. When using non-OpenAI providers (e.g., Ollama), cache keys collide and return wrong embeddings from a different provider's model.
2. No provider auto-detection
The system should detect whether the agent's configured LLM provider supports embedding, and if so, automatically use that provider's embedding model as the default. This avoids requiring separate embedding provider configuration when the main provider already has embedding capability.
Proposed Solution
- Detect provider embedding support → auto-select embedding model
- Use actual provider name in cache key instead of hardcoded
"openai"
Impact
- Cache correctness — prevents returning wrong embeddings when switching providers
- UX — reduces configuration burden for users whose LLM provider already supports embeddings
Problem
Two related problems in the embedding system:
1. Cache key bug
clawhive-memory/src/embedding.rs:547hardcodeslet provider = "openai"as cache key. When using non-OpenAI providers (e.g., Ollama), cache keys collide and return wrong embeddings from a different provider's model.2. No provider auto-detection
The system should detect whether the agent's configured LLM provider supports embedding, and if so, automatically use that provider's embedding model as the default. This avoids requiring separate embedding provider configuration when the main provider already has embedding capability.
Proposed Solution
"openai"Impact