Skip to content

Fix OpenAI embedding config using wrong JSON key for model field#565

Merged
crspeller merged 1 commit into
masterfrom
fix/embedding-model-json-key
Apr 8, 2026
Merged

Fix OpenAI embedding config using wrong JSON key for model field#565
crspeller merged 1 commit into
masterfrom
fix/embedding-model-json-key

Conversation

@crspeller
Copy link
Copy Markdown
Member

@crspeller crspeller commented Mar 19, 2026

Summary

  • The OpenAIEmbeddingConfig struct introduced in the Bifrost migration (Migration to Bifrost #484) used defaultModel as its JSON tag, but the system console and existing saved configs use embeddingModel. This caused the model field to deserialize as empty, breaking embedding requests for OpenAI and OpenAI-compatible providers.
  • Added a test that verifies JSON deserialization of both OpenAIEmbeddingConfig and BifrostEmbeddingConfig to catch field mismatches.

Test plan

  • Verify TestEmbeddingConfigJSONKeys passes
  • Verify existing embedding search tests pass

Summary by CodeRabbit

  • Breaking Changes

    • Updated OpenAI embedding configuration parameter name from defaultModel to embeddingModel. Users with existing configurations must update their configuration files accordingly.
  • Tests

    • Added comprehensive tests for embedding configuration JSON deserialization to ensure proper parameter mapping.

The OpenAIEmbeddingConfig struct used `defaultModel` as its JSON tag,
but the system console and existing saved configs use `embeddingModel`.
This caused the model field to deserialize as empty, breaking embedding
requests for OpenAI and OpenAI-compatible providers.
@github-actions
Copy link
Copy Markdown

🤖 LLM Evaluation Results

OpenAI

⚠️ Overall: 18/19 tests passed (94.7%)

Provider Total Passed Failed Pass Rate
⚠️ OPENAI 19 18 1 94.7%

❌ Failed Evaluations

Show 1 failures

OPENAI

1. TestReactEval/[openai]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the text "smiley_cat", not an actual cat emoji (e.g., 😺/🐱) or a heart/love emoji (e.g., ❤️/💕).

Anthropic

⚠️ Overall: 18/19 tests passed (94.7%)

Provider Total Passed Failed Pass Rate
⚠️ ANTHROPIC 19 18 1 94.7%

❌ Failed Evaluations

Show 1 failures

ANTHROPIC

1. TestReactEval/[anthropic]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the text "heart_eyes_cat", which is neither an actual cat emoji nor a heart/love emoji character.

This comment was automatically generated by the eval CI pipeline.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: e8a11b16-0c76-440c-bb43-9ecb8d0fc93b

📥 Commits

Reviewing files that changed from the base of the PR and between d55f165 and 7ad4e76.

📒 Files selected for processing (2)
  • search/embeddings.go
  • search/embeddings_test.go

📝 Walkthrough

Walkthrough

Updated the JSON configuration parameter name for OpenAI embedding model from defaultModel to embeddingModel in the OpenAIEmbeddingConfig struct, with corresponding test coverage for JSON deserialization validation of embedding configuration structures.

Changes

Cohort / File(s) Summary
Configuration Parameter Update
search/embeddings.go
Updated JSON tag for OpenAIEmbeddingConfig.Model field from json:"defaultModel" to json:"embeddingModel".
Test Coverage
search/embeddings_test.go
Added TestEmbeddingConfigJSONKeys test verifying JSON deserialization of OpenAIEmbeddingConfig and BifrostEmbeddingConfig with correct field mappings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

Setup Cloud Test Server

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main change: fixing a JSON key mismatch in OpenAI embedding configuration where 'defaultModel' was incorrectly used instead of 'embeddingModel'.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/embedding-model-json-key
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.

@crspeller crspeller requested a review from nickmisasi April 8, 2026 17:11
@crspeller crspeller merged commit 87e05fa into master Apr 8, 2026
33 checks passed
@crspeller crspeller deleted the fix/embedding-model-json-key branch April 8, 2026 17:14
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.

2 participants