opencode-codebase-index 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8942,10 +8942,19 @@ var Indexer = class {
8942
8942
  });
8943
8943
  const embeddingStartTime = performance2.now();
8944
8944
  const embeddingQuery = stripFilePathHint(query);
8945
- const embedding = await this.getQueryEmbedding(embeddingQuery, provider);
8945
+ let embedding;
8946
+ try {
8947
+ embedding = await this.getQueryEmbedding(embeddingQuery, provider);
8948
+ } catch (error) {
8949
+ this.logger.warn("Query embedding failed; falling back to keyword-only search", {
8950
+ query,
8951
+ error: getErrorMessage2(error),
8952
+ action: "Check the embedding provider configuration and retry search after restoring provider health."
8953
+ });
8954
+ }
8946
8955
  const embeddingMs = performance2.now() - embeddingStartTime;
8947
8956
  const vectorStartTime = performance2.now();
8948
- const semanticResults = store.search(embedding, maxResults * 4);
8957
+ const semanticResults = embedding ? store.search(embedding, maxResults * 4) : [];
8949
8958
  const vectorMs = performance2.now() - vectorStartTime;
8950
8959
  const keywordStartTime = performance2.now();
8951
8960
  const keywordResults = await this.keywordSearch(query, maxResults * 4, store, invertedIndex);
@@ -8980,12 +8989,13 @@ var Indexer = class {
8980
8989
  });
8981
8990
  }
8982
8991
  const fusionStartTime = performance2.now();
8992
+ const rankingHybridWeight = embedding === void 0 && fusionStrategy === "weighted" ? 1 : effectiveHybridWeight;
8983
8993
  const combined = rankHybridResults(query, semanticCandidates, keywordCandidates, {
8984
8994
  fusionStrategy,
8985
8995
  rrfK,
8986
8996
  rerankTopN,
8987
8997
  limit: maxResults,
8988
- hybridWeight: effectiveHybridWeight,
8998
+ hybridWeight: rankingHybridWeight,
8989
8999
  prioritizeSourcePaths: sourceIntent
8990
9000
  });
8991
9001
  const rerankedCombined = await this.rerankCandidatesWithApi(query, combined, {