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.cjs CHANGED
@@ -8943,10 +8943,19 @@ var Indexer = class {
8943
8943
  });
8944
8944
  const embeddingStartTime = import_perf_hooks.performance.now();
8945
8945
  const embeddingQuery = stripFilePathHint(query);
8946
- const embedding = await this.getQueryEmbedding(embeddingQuery, provider);
8946
+ let embedding;
8947
+ try {
8948
+ embedding = await this.getQueryEmbedding(embeddingQuery, provider);
8949
+ } catch (error) {
8950
+ this.logger.warn("Query embedding failed; falling back to keyword-only search", {
8951
+ query,
8952
+ error: getErrorMessage2(error),
8953
+ action: "Check the embedding provider configuration and retry search after restoring provider health."
8954
+ });
8955
+ }
8947
8956
  const embeddingMs = import_perf_hooks.performance.now() - embeddingStartTime;
8948
8957
  const vectorStartTime = import_perf_hooks.performance.now();
8949
- const semanticResults = store.search(embedding, maxResults * 4);
8958
+ const semanticResults = embedding ? store.search(embedding, maxResults * 4) : [];
8950
8959
  const vectorMs = import_perf_hooks.performance.now() - vectorStartTime;
8951
8960
  const keywordStartTime = import_perf_hooks.performance.now();
8952
8961
  const keywordResults = await this.keywordSearch(query, maxResults * 4, store, invertedIndex);
@@ -8981,12 +8990,13 @@ var Indexer = class {
8981
8990
  });
8982
8991
  }
8983
8992
  const fusionStartTime = import_perf_hooks.performance.now();
8993
+ const rankingHybridWeight = embedding === void 0 && fusionStrategy === "weighted" ? 1 : effectiveHybridWeight;
8984
8994
  const combined = rankHybridResults(query, semanticCandidates, keywordCandidates, {
8985
8995
  fusionStrategy,
8986
8996
  rrfK,
8987
8997
  rerankTopN,
8988
8998
  limit: maxResults,
8989
- hybridWeight: effectiveHybridWeight,
8999
+ hybridWeight: rankingHybridWeight,
8990
9000
  prioritizeSourcePaths: sourceIntent
8991
9001
  });
8992
9002
  const rerankedCombined = await this.rerankCandidatesWithApi(query, combined, {