Skip to content

fix(indexing): pass configured dimension to OpenAI-compatible embedder - #14580

Merged
intentionally-left-nil merged 2 commits into
Kilo-Org:mainfrom
magiccodelab:fix-indexing-openai-compatible-dimension
Sep 25, 2026
Merged

intentionally-left-nil merged 2 commits into
Kilo-Org:mainfrom
magiccodelab:fix-indexing-openai-compatible-dimension

Conversation

@magiccodelab

Copy link
Copy Markdown
Contributor

Fixes #14579

Summary

Pass options: { dimensions: config.modelDimension } when instantiating OpenAICompatibleEmbedder in CodeIndexServiceFactory.createEmbedder().

Why

When configuring an OpenAI-compatible embedding provider with a custom dimension (such as 4096 for MRL-enabled models like Qwen3-Embedding-8B or OpenAI text-embedding-3), the vector store table was created with the configured dimension, but OpenAICompatibleEmbedder never received config.modelDimension.

As a result, HTTP requests to the embedding endpoint did not include the "dimensions" parameter, causing the provider to fall back to its server default dimension (e.g. 768) and triggering a dimension mismatch error during semantic_search:
GenericFailure, Invalid input, No vector column found to match with the query vector dimension: 768

This change brings openai-compatible in line with the other providers (openrouter, ollama, kilo) which already forward config.modelDimension.

Testing

  • Added unit tests in packages/kilo-indexing/test/kilocode/indexing/service-factory.test.ts verifying that dimensions is forwarded to OpenAI-compatible embedding requests when configured, and omitted when unset.
  • Ran package unit tests and typechecks (bun test, tsgo --noEmit).

@kilo-code-bot

kilo-code-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The change correctly forwards config.modelDimension into OpenAICompatibleEmbedder (positional args match the constructor: baseUrl, apiKey, modelId, maxItemTokens, options), consistent with kilo, ollama, and openrouter. The embedder already conditionally spreads dimensions, so an unset value stays omitted, and both the SDK and full-endpoint request paths pick it up. resolveEmbeddingProfile yields no static dimension for openai-compatible, so the vector store already required an explicit dimension; this closes the mismatch. Tests cover the set and unset cases.

Files Reviewed (3 files)
  • .changeset/openai-compatible-embedding-dimensions.md
  • packages/kilo-indexing/src/indexing/service-factory.ts
  • packages/kilo-indexing/test/kilocode/indexing/service-factory.test.ts

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

@intentionally-left-nil
intentionally-left-nil merged commit 24167bd into Kilo-Org:main Sep 25, 2026
30 checks passed
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.

fix(indexing): configured embedding dimension is not passed to OpenAI-compatible embedder

2 participants