Summary
When Semble code search encounters an error (e.g., missing HuggingFace model weights, network failure, corrupted download), the error is silently swallowed and the user sees only:
No relevant code snippets found for the query: "..."
There is no indication that a failure occurred. The UI shows green "Indexed — Semble is ready" status, but every search returns empty results.
Root Cause
1. Silent catch in SembleProvider.searchIndex()
src/services/code-index/semble/provider.ts:202-213
} catch (error: any) {
const errorMessage = error?.message || String(error)
console.error("[SembleProvider] Search failed:", errorMessage)
return [] // ← silently returns empty array, caller has no way to distinguish "no results" from "error"
}
2. Missing HuggingFace model weights
When Semble runs for the first time, it downloads minishlab/potion-code-16M from HuggingFace. If the download is interrupted or the hub is unavailable, the cache ends up with only metadata files (config.json, tokenizer.json) but no model weight files (.safetensors / .bin). The error surfaces only on first semble search.
3. No model validation at init
SembleProvider._doInitialize() only verifies the binary (semble --help) but does NOT test that the embedding model downloads successfully. The model download happens on first search call (on-the-fly), which is when the error first surfaces.
✅ FIX APPLIED
Fix 1: Error propagation (was silent return [])
SembleProvider.searchIndex() now throws the error instead of returning []:
throw new Error(`Semble search failed: ${errorMessage}`)
This propagates through manager.searchIndex() → CodebaseSearchTool.execute() → handleError(), so the user sees the real error (e.g., "Semble search failed: Could not find expected model files...") instead of misleading "No relevant code snippets found".
Fix 2: Embedding model validation at init
SembleCLI.checkModel() (new method) runs a lightweight semble search "health" . -k 1 smoke test with 60s timeout, forcing the model download and verifying it works during initialization, not on first real search.
SembleProvider._doInitialize() now calls checkModel() after checkInstalled(), showing "Downloading embedding model..." status. If model files are missing or download fails, state is set to "Error" with the actual error message instead of "Indexed — ready".
What this means for users:
- ❌ Before: Green "Semble is ready" → every search silently empty → user sees "No relevant code snippets found" with no error indication
- ✅ After: Model missing → status shows "Error: Semble model download failed: ..." → search tool shows real error message
Files changed:
Test coverage:
- 90 Semble tests passing (including 5 new)
- Clean build + VSIX validated
Summary
When Semble code search encounters an error (e.g., missing HuggingFace model weights, network failure, corrupted download), the error is silently swallowed and the user sees only:
There is no indication that a failure occurred. The UI shows green "Indexed — Semble is ready" status, but every search returns empty results.
Root Cause
1. Silent catch in
SembleProvider.searchIndex()src/services/code-index/semble/provider.ts:202-2132. Missing HuggingFace model weights
When Semble runs for the first time, it downloads
minishlab/potion-code-16Mfrom HuggingFace. If the download is interrupted or the hub is unavailable, the cache ends up with only metadata files (config.json, tokenizer.json) but no model weight files (.safetensors / .bin). The error surfaces only on firstsemble search.3. No model validation at init
SembleProvider._doInitialize()only verifies the binary (semble --help) but does NOT test that the embedding model downloads successfully. The model download happens on first search call (on-the-fly), which is when the error first surfaces.✅ FIX APPLIED
Fix 1: Error propagation (was silent
return [])SembleProvider.searchIndex()now throws the error instead of returning[]:This propagates through
manager.searchIndex()→CodebaseSearchTool.execute()→handleError(), so the user sees the real error (e.g., "Semble search failed: Could not find expected model files...") instead of misleading "No relevant code snippets found".Fix 2: Embedding model validation at init
SembleCLI.checkModel()(new method) runs a lightweightsemble search "health" . -k 1smoke test with 60s timeout, forcing the model download and verifying it works during initialization, not on first real search.SembleProvider._doInitialize()now callscheckModel()aftercheckInstalled(), showing "Downloading embedding model..." status. If model files are missing or download fails, state is set to "Error" with the actual error message instead of "Indexed — ready".What this means for users:
Files changed:
src/services/code-index/semble/provider.ts— error propagation + checkModel() call in initsrc/services/code-index/semble/semble-cli.ts— new checkModel() methodsrc/services/code-index/semble/__tests__/provider.spec.ts— 5 new tests, updated assertionssrc/services/code-index/semble/__tests__/semble-cli.spec.ts— 3 new tests for checkModel()Test coverage: