Skip to content

fix(kernel): fix embedding model config being hardcoded and ignored#275

Open
woodcoal wants to merge 1 commit intoRightNow-AI:mainfrom
woodcoal:patch-1
Open

fix(kernel): fix embedding model config being hardcoded and ignored#275
woodcoal wants to merge 1 commit intoRightNow-AI:mainfrom
woodcoal:patch-1

Conversation

@woodcoal
Copy link

@woodcoal woodcoal commented Mar 3, 2026

Problem:

  • In kernel.rs, embedding driver creation hardcoded the model name
  • Config file setting memory.embedding_model was completely ignored
  • Always used "text-embedding-3-small" or "nomic-embed-text" instead of user config

Solution:

  • Modified create_embedding_driver calls to use config.memory.embedding_model
  • Applied config model in all three auto-detection paths:
    1. When embedding_provider is explicitly configured
    2. When auto-detecting OpenAI
    3. When auto-detecting Ollama
  • Added logging to show the actual model being used
  • Maintained backward compatibility: use defaults when config is empty

Scope:

  • crates/openfang-kernel/src/kernel.rs: lines 757-803

Testing:

  1. Set custom embedding_model in config file
  2. Check logs after startup to verify model name
  3. Verify vector search functionality works correctly

Problem:
- In kernel.rs, embedding driver creation hardcoded the model name
- Config file setting memory.embedding_model was completely ignored
- Always used "text-embedding-3-small" or "nomic-embed-text" instead of user config

Solution:
- Modified create_embedding_driver calls to use config.memory.embedding_model
- Applied config model in all three auto-detection paths:
  1. When embedding_provider is explicitly configured
  2. When auto-detecting OpenAI
  3. When auto-detecting Ollama
- Added logging to show the actual model being used
- Maintained backward compatibility: use defaults when config is empty

Scope:
- crates/openfang-kernel/src/kernel.rs: lines 757-803

Testing:
1. Set custom embedding_model in config file
2. Check logs after startup to verify model name
3. Verify vector search functionality works correctly
egargale pushed a commit to egargale/openfang that referenced this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant