feat(selfhost): fail-LOUD boot preflight when RAG is enabled with no embed-capable provider - #8793
Merged
Conversation
…embed-capable provider (#8765) With LOOPOVER_REVIEW_RAG=true, no AI_EMBED_BASE_URL, and a CLI-only provider chain (claude-code/codex), every embed call throws *_no_embed by design — the RAG index never populates and every review pays a cold-index no-op, surfaced only as per-batch runtime errors. The review-CLI path already gets a #1566 boot preflight; RAG's embed dependency now gets the same treatment: - shouldWarnRagEmbedUnavailable (pure, src/selfhost/ai.ts): RAG on + no dedicated embed endpoint + every provider CLI-subscription. Any OpenAI-compatible chain member silences it (the chain falls through *_no_embed to it); no-AI-at-all stays silent (already loud elsewhere). - server.ts shouts selfhost_rag_embed_unavailable once at boot, warn-only — runtime degrade behavior unchanged. - docker-compose.yml: the qdrant/ollama profile hints now name AI_EMBED_BASE_URL/AI_EMBED_MODEL as REQUIRED for RAG on CLI-only chains (previously only .env.example's deep reference explained this).
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | ccc2f37 | Commit Preview URL Branch Preview URL |
Jul 26 2026, 06:08 AM |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Bundle ReportChanges will increase total bundle size by 54 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8793 +/- ##
==========================================
- Coverage 93.81% 92.26% -1.55%
==========================================
Files 797 797
Lines 79555 79560 +5
Branches 24109 24112 +3
==========================================
- Hits 74633 73405 -1228
- Misses 3556 5090 +1534
+ Partials 1366 1065 -301
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RAG-audit hardening from epic #8757: the one easy-to-hit misconfiguration that silently breaks RAG indexing forever (
LOOPOVER_REVIEW_RAG=true+AI_PROVIDER=claude-code+ noAI_EMBED_BASE_URL→ every embed throwsclaude_code_no_embed, the index stays empty, and the only signal is per-batch runtime error logs) now shouts once at boot, mirroring the #1566 review-CLI preflight.Changes
src/selfhost/ai.ts—shouldWarnRagEmbedUnavailable(pure, exported, fully tested): warns iff RAG is enabled ANDAI_EMBED_BASE_URLis unset AND every configured provider is CLI-subscription. Any OpenAI-compatible member silences it (the chain legitimately falls through*_no_embedto it); an empty provider list stays silent (that absence is already loud for its own reason).src/server.ts— oneselfhost_rag_embed_unavailableerror log at boot with the concrete fix in the message. Warn-only; runtime degrade unchanged. (server.tsis codecov-ignored by longstanding config; the logic lives in the tested helper.)docker-compose.yml— the qdrant/ollama profile hints now nameAI_EMBED_BASE_URL/AI_EMBED_MODELas required for RAG on CLI-only chains, instead of that living only in.env.example's deep reference. Compose config validated.Test plan
npm run typecheck— cleanselfhost-ai.test.ts192/192, including 5 new preflight cases (warn, RAG-off, dedicated endpoint, embed-capable chain member, no-AI)docker compose config --quietpassesCloses #8765