compound-agent 1.6.5 → 1.7.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.d.ts CHANGED
@@ -3123,7 +3123,7 @@ interface PlanRetrievalResult {
3123
3123
  * Uses hybrid search (vector similarity + FTS5 keyword matching)
3124
3124
  * then applies ranking boosts for severity, recency, and confirmation.
3125
3125
  *
3126
- * Hard-fails if embeddings are unavailable (propagates error from embedText).
3126
+ * Falls back to keyword-only search when the embedding model is unavailable.
3127
3127
  *
3128
3128
  * @param repoRoot - Repository root directory
3129
3129
  * @param planText - The plan text to search against
package/dist/index.js CHANGED
@@ -2380,11 +2380,25 @@ init_storage();
2380
2380
  var DEFAULT_LIMIT3 = 5;
2381
2381
  async function retrieveForPlan(repoRoot, planText, limit = DEFAULT_LIMIT3) {
2382
2382
  const candidateLimit = limit * CANDIDATE_MULTIPLIER;
2383
- const [vectorResults, keywordResults] = await Promise.all([
2384
- searchVector(repoRoot, planText, { limit: candidateLimit }),
2385
- searchKeywordScored(repoRoot, planText, candidateLimit)
2386
- ]);
2387
- const merged = mergeHybridResults(vectorResults, keywordResults, { minScore: MIN_HYBRID_SCORE });
2383
+ let vectorResults = [];
2384
+ let vectorFailed = false;
2385
+ const keywordResultsPromise = searchKeywordScored(repoRoot, planText, candidateLimit);
2386
+ try {
2387
+ vectorResults = await searchVector(repoRoot, planText, { limit: candidateLimit });
2388
+ } catch {
2389
+ vectorFailed = true;
2390
+ console.error("[compound-agent] Vector search unavailable, falling back to keyword-only search");
2391
+ }
2392
+ const keywordResults = await keywordResultsPromise;
2393
+ let merged;
2394
+ if (vectorFailed) {
2395
+ merged = mergeHybridResults([], keywordResults, {
2396
+ vectorWeight: 0,
2397
+ textWeight: DEFAULT_TEXT_WEIGHT
2398
+ });
2399
+ } else {
2400
+ merged = mergeHybridResults(vectorResults, keywordResults, { minScore: MIN_HYBRID_SCORE });
2401
+ }
2388
2402
  const ranked = rankLessons(merged);
2389
2403
  const topLessons = ranked.slice(0, limit);
2390
2404
  if (topLessons.length > 0) {