Skip to content

feat(selfhost): fail-LOUD boot preflight when RAG is enabled with no embed-capable provider - #8793

Merged
JSONbored merged 3 commits into
mainfrom
feat/rag-embed-preflight
Jul 26, 2026
Merged

feat(selfhost): fail-LOUD boot preflight when RAG is enabled with no embed-capable provider#8793
JSONbored merged 3 commits into
mainfrom
feat/rag-embed-preflight

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

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 + no AI_EMBED_BASE_URL → every embed throws claude_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.tsshouldWarnRagEmbedUnavailable (pure, exported, fully tested): warns iff RAG is enabled AND AI_EMBED_BASE_URL is unset AND every configured provider is CLI-subscription. Any OpenAI-compatible member silences it (the chain legitimately falls through *_no_embed to it); an empty provider list stays silent (that absence is already loud for its own reason).
  • src/server.ts — one selfhost_rag_embed_unavailable error log at boot with the concrete fix in the message. Warn-only; runtime degrade unchanged. (server.ts is codecov-ignored by longstanding config; the logic lives in the tested helper.)
  • 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, instead of that living only in .env.example's deep reference. Compose config validated.

Test plan

  • npm run typecheck — clean
  • selfhost-ai.test.ts 192/192, including 5 new preflight cases (warn, RAG-off, dedicated endpoint, embed-capable chain member, no-AI)
  • docker compose config --quiet passes

Closes #8765

…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).
@JSONbored JSONbored self-assigned this Jul 26, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 54 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
loopover-ui 7.42MB 54 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: loopover-ui

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/add-scalar-classes-VQx7yce9.js (New) 2.17MB 2.17MB 100.0% 🚀
assets/tanstack-vendor-kCBy_4RV.js (New) 741.77kB 741.77kB 100.0% 🚀
assets/docs.fumadocs-spike-api-reference-BypExbIs.js (New) 442.92kB 442.92kB 100.0% 🚀
assets/AgentScalarChatInterface.vue-CpuBGvYS.js (New) 201.72kB 201.72kB 100.0% 🚀
assets/modal-BwEBTsAj.js (New) 184.38kB 184.38kB 100.0% 🚀
assets/client-BBQZ5pPH.js (New) 146.06kB 146.06kB 100.0% 🚀
assets/self-hosting-configuration-D4EI4E05.js (New) 101.33kB 101.33kB 100.0% 🚀
assets/maintainer-panel-CGMGocgu.js (New) 79.03kB 79.03kB 100.0% 🚀
assets/ui-vendor-kYDDL6s_.js (New) 57.05kB 57.05kB 100.0% 🚀
assets/routes-cJJMY1_S.js (New) 34.98kB 34.98kB 100.0% 🚀
assets/owner-panel-DHnrGrs9.js (New) 27.46kB 27.46kB 100.0% 🚀
assets/app-B47ujKT-.js (New) 25.94kB 25.94kB 100.0% 🚀
assets/app.runs-Dludd1Lb.js (New) 20.28kB 20.28kB 100.0% 🚀
assets/miner-panel-DsUOzDed.js (New) 20.28kB 20.28kB 100.0% 🚀
assets/api._op-nJPolQRA.js (New) 17.57kB 17.57kB 100.0% 🚀
assets/self-hosting-docs-audit-DcSlUelp.js (New) 16.6kB 16.6kB 100.0% 🚀
assets/app.index-T7wK510X.js (New) 15.62kB 15.62kB 100.0% 🚀
assets/docs._slug-D5QgQYus.js (New) 15.37kB 15.37kB 100.0% 🚀
assets/playground-panel-CtbuyWRc.js (New) 14.49kB 14.49kB 100.0% 🚀
assets/fairness-BoCqtw5C.js (New) 10.6kB 10.6kB 100.0% 🚀
assets/app.audit-C8YzUlIW.js (New) 10.11kB 10.11kB 100.0% 🚀
assets/app.config-generator-shjBM3NL.js (New) 10.09kB 10.09kB 100.0% 🚀
assets/maintainers-ci7hYGs7.js (New) 8.09kB 8.09kB 100.0% 🚀
assets/miners-Czo-gNcx.js (New) 7.91kB 7.91kB 100.0% 🚀
assets/agents-BXGZFGVE.js (New) 7.8kB 7.8kB 100.0% 🚀
assets/commands-panel-CkPYcEkB.js (New) 6.65kB 6.65kB 100.0% 🚀
assets/roadmap-BoQPluCV.js (New) 6.52kB 6.52kB 100.0% 🚀
assets/maintainer-workflow-BpdLxeUA.js (New) 6.52kB 6.52kB 100.0% 🚀
assets/digest-panel-BOpHAqzA.js (New) 6.18kB 6.18kB 100.0% 🚀
assets/repos._owner._repo.quality-BZysOf0Y.js (New) 6.14kB 6.14kB 100.0% 🚀
assets/docs-nav-Dg2Btr14.js (New) 5.95kB 5.95kB 100.0% 🚀
assets/docs.index-D0ITDxEB.js (New) 5.95kB 5.95kB 100.0% 🚀
assets/api.index-C-6Vg2DM.js (New) 4.7kB 4.7kB 100.0% 🚀
assets/docs-C86wjwiC.js (New) 2.7kB 2.7kB 100.0% 🚀
assets/api-_9QLNA-B.js (New) 2.69kB 2.69kB 100.0% 🚀
assets/docs-page-BhvY9qKA.js (New) 2.1kB 2.1kB 100.0% 🚀
assets/table-DSOlws3f.js (New) 1.75kB 1.75kB 100.0% 🚀
assets/app.workbench-HwQN_7Ia.js (New) 1.58kB 1.58kB 100.0% 🚀
assets/tooltip-CqnF5k-u.js (New) 1.47kB 1.47kB 100.0% 🚀
assets/session-Dv0iv9lA.js (New) 1.45kB 1.45kB 100.0% 🚀
assets/tabs-Ckfm5tdE.js (New) 1.39kB 1.39kB 100.0% 🚀
assets/app.repos-9Ysww6LV.js (New) 1.07kB 1.07kB 100.0% 🚀
assets/input-hkQr5gK1.js (New) 796 bytes 796 bytes 100.0% 🚀
assets/file-cog-CuMV1mSF.js (New) 758 bytes 758 bytes 100.0% 🚀
assets/app.maintainer-CtQUQNre.js (New) 502 bytes 502 bytes 100.0% 🚀
assets/sparkles-BuyKxUEI.js (New) 494 bytes 494 bytes 100.0% 🚀
assets/app.owner-DpsnBKY_.js (New) 474 bytes 474 bytes 100.0% 🚀
assets/app.commands-Cis_vJiC.js (New) 455 bytes 455 bytes 100.0% 🚀
assets/app.playground-BW202EFt.js (New) 442 bytes 442 bytes 100.0% 🚀
assets/index-CKZtqq1K.js (New) 438 bytes 438 bytes 100.0% 🚀
assets/app.digest-heD1aNjP.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/eye-off-CZ_Ls7E7.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/app.miner-DyuvxGoJ.js (New) 422 bytes 422 bytes 100.0% 🚀
assets/key-round-B7w-HuDb.js (New) 355 bytes 355 bytes 100.0% 🚀
assets/bot-DbnFMR1f.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/trash-2-E5V5lFgO.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/save-D1Fem9CZ.js (New) 327 bytes 327 bytes 100.0% 🚀
assets/git-pull-request-arrow-Dh9xOIQO.js (New) 321 bytes 321 bytes 100.0% 🚀
assets/wrench-81-Z07fm.js (New) 303 bytes 303 bytes 100.0% 🚀
assets/list-checks-6fL_KRiV.js (New) 279 bytes 279 bytes 100.0% 🚀
assets/workflow-gRPq9wlF.js (New) 265 bytes 265 bytes 100.0% 🚀
assets/compass-DJDpXCQx.js (New) 251 bytes 251 bytes 100.0% 🚀
assets/history-Cds5Honj.js (New) 237 bytes 237 bytes 100.0% 🚀
assets/activity-X1IzYMj-.js (New) 234 bytes 234 bytes 100.0% 🚀
assets/message-square-tBcp851B.js (New) 233 bytes 233 bytes 100.0% 🚀
assets/lock-BGv12g5f.js (New) 206 bytes 206 bytes 100.0% 🚀
assets/rotate-cw-C5ogBkG-.js (New) 201 bytes 201 bytes 100.0% 🚀
assets/play-bcnhG4rm.js (New) 190 bytes 190 bytes 100.0% 🚀
assets/circle-check-BxLZruyh.js (New) 178 bytes 178 bytes 100.0% 🚀
assets/search-Dj2cHhZn.js (New) 174 bytes 174 bytes 100.0% 🚀
assets/circle-xh1fadV9.js (New) 130 bytes 130 bytes 100.0% 🚀
assets/add-scalar-classes-QQBXNrni.js (Deleted) -2.17MB 0 bytes -100.0% 🗑️
assets/tanstack-vendor-C-7kkLeZ.js (Deleted) -741.77kB 0 bytes -100.0% 🗑️
assets/docs.fumadocs-spike-api-reference-CW1i0v_i.js (Deleted) -442.92kB 0 bytes -100.0% 🗑️
assets/AgentScalarChatInterface.vue-BAtOW2qk.js (Deleted) -201.72kB 0 bytes -100.0% 🗑️
assets/modal-ByGNR6H7.js (Deleted) -184.38kB 0 bytes -100.0% 🗑️
assets/client-BbOqYIUH.js (Deleted) -146.06kB 0 bytes -100.0% 🗑️
assets/self-hosting-configuration-qCwyKRSY.js (Deleted) -101.27kB 0 bytes -100.0% 🗑️
assets/maintainer-panel-5o5VtRjG.js (Deleted) -79.03kB 0 bytes -100.0% 🗑️
assets/ui-vendor-B7rmUv2n.js (Deleted) -57.05kB 0 bytes -100.0% 🗑️
assets/routes-DKTrtxc7.js (Deleted) -34.98kB 0 bytes -100.0% 🗑️
assets/owner-panel-DsMzeepo.js (Deleted) -27.46kB 0 bytes -100.0% 🗑️
assets/app-D2Y1LJ6t.js (Deleted) -25.94kB 0 bytes -100.0% 🗑️
assets/app.runs-BPVAYZE9.js (Deleted) -20.28kB 0 bytes -100.0% 🗑️
assets/miner-panel-DYb9qYVV.js (Deleted) -20.28kB 0 bytes -100.0% 🗑️
assets/api._op-tUx7AhoJ.js (Deleted) -17.57kB 0 bytes -100.0% 🗑️
assets/self-hosting-docs-audit-B9yCk8Yu.js (Deleted) -16.6kB 0 bytes -100.0% 🗑️
assets/app.index-B7iou7VP.js (Deleted) -15.62kB 0 bytes -100.0% 🗑️
assets/docs._slug-D6IY9J6P.js (Deleted) -15.37kB 0 bytes -100.0% 🗑️
assets/playground-panel-BCw_8bRU.js (Deleted) -14.49kB 0 bytes -100.0% 🗑️
assets/fairness-B_2J8oKB.js (Deleted) -10.6kB 0 bytes -100.0% 🗑️
assets/app.audit-D7gvKBRR.js (Deleted) -10.11kB 0 bytes -100.0% 🗑️
assets/app.config-generator-Ddpt5nFE.js (Deleted) -10.09kB 0 bytes -100.0% 🗑️
assets/maintainers-CQOtsZp_.js (Deleted) -8.09kB 0 bytes -100.0% 🗑️
assets/miners-DKH8cyLB.js (Deleted) -7.91kB 0 bytes -100.0% 🗑️
assets/agents-DuQdbnWd.js (Deleted) -7.8kB 0 bytes -100.0% 🗑️
assets/commands-panel-D8G_Bfow.js (Deleted) -6.65kB 0 bytes -100.0% 🗑️
assets/roadmap-6YKSZ3Aj.js (Deleted) -6.52kB 0 bytes -100.0% 🗑️
assets/maintainer-workflow-FTxPYuGY.js (Deleted) -6.52kB 0 bytes -100.0% 🗑️
assets/digest-panel-D-_wwxqC.js (Deleted) -6.18kB 0 bytes -100.0% 🗑️
assets/repos._owner._repo.quality-BRMqeHR-.js (Deleted) -6.14kB 0 bytes -100.0% 🗑️
assets/docs-nav-CSwCT7Eu.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/docs.index-Cxw3I18-.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/api.index-CoKzg-jV.js (Deleted) -4.7kB 0 bytes -100.0% 🗑️
assets/docs-DFDilYaT.js (Deleted) -2.7kB 0 bytes -100.0% 🗑️
assets/api-CDFImMA8.js (Deleted) -2.69kB 0 bytes -100.0% 🗑️
assets/docs-page-DEIEN3y3.js (Deleted) -2.1kB 0 bytes -100.0% 🗑️
assets/table-Ce_MYShH.js (Deleted) -1.75kB 0 bytes -100.0% 🗑️
assets/app.workbench-xkiPnWky.js (Deleted) -1.58kB 0 bytes -100.0% 🗑️
assets/tooltip--KAJcECu.js (Deleted) -1.47kB 0 bytes -100.0% 🗑️
assets/session-B6U2HiHb.js (Deleted) -1.45kB 0 bytes -100.0% 🗑️
assets/tabs-D8B4McTS.js (Deleted) -1.39kB 0 bytes -100.0% 🗑️
assets/app.repos-Ca7jldVc.js (Deleted) -1.07kB 0 bytes -100.0% 🗑️
assets/input-DjJPGITV.js (Deleted) -796 bytes 0 bytes -100.0% 🗑️
assets/file-cog-DLbqOiIz.js (Deleted) -758 bytes 0 bytes -100.0% 🗑️
assets/app.maintainer-CJ-KKptA.js (Deleted) -502 bytes 0 bytes -100.0% 🗑️
assets/sparkles-B3dSTxL-.js (Deleted) -494 bytes 0 bytes -100.0% 🗑️
assets/app.owner-G5ds5cke.js (Deleted) -474 bytes 0 bytes -100.0% 🗑️
assets/app.commands-aRio3qHk.js (Deleted) -455 bytes 0 bytes -100.0% 🗑️
assets/app.playground-LOGlYsG1.js (Deleted) -442 bytes 0 bytes -100.0% 🗑️
assets/index-zylH3Kc1.js (Deleted) -438 bytes 0 bytes -100.0% 🗑️
assets/app.digest-BHSYOVmp.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/eye-off-DmM_5bfK.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/app.miner-MxLozP_K.js (Deleted) -422 bytes 0 bytes -100.0% 🗑️
assets/key-round-D2uwfSmi.js (Deleted) -355 bytes 0 bytes -100.0% 🗑️
assets/bot-CmFnbq6b.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/trash-2-drPHrL1U.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/save-2OoxhC-1.js (Deleted) -327 bytes 0 bytes -100.0% 🗑️
assets/git-pull-request-arrow-DEq_D3eQ.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/wrench-DAHwbBxY.js (Deleted) -303 bytes 0 bytes -100.0% 🗑️
assets/list-checks-pRlVqFJo.js (Deleted) -279 bytes 0 bytes -100.0% 🗑️
assets/workflow-04KJBT9u.js (Deleted) -265 bytes 0 bytes -100.0% 🗑️
assets/compass-ioQ93crJ.js (Deleted) -251 bytes 0 bytes -100.0% 🗑️
assets/history-DFqQfWQH.js (Deleted) -237 bytes 0 bytes -100.0% 🗑️
assets/activity-CCrKJK3H.js (Deleted) -234 bytes 0 bytes -100.0% 🗑️
assets/message-square-yV2nswD6.js (Deleted) -233 bytes 0 bytes -100.0% 🗑️
assets/lock-BIgr9A-k.js (Deleted) -206 bytes 0 bytes -100.0% 🗑️
assets/rotate-cw-CvcIuVpS.js (Deleted) -201 bytes 0 bytes -100.0% 🗑️
assets/play-pdSrTVTK.js (Deleted) -190 bytes 0 bytes -100.0% 🗑️
assets/circle-check-BjXDgS-0.js (Deleted) -178 bytes 0 bytes -100.0% 🗑️
assets/search-Dl03kZPo.js (Deleted) -174 bytes 0 bytes -100.0% 🗑️
assets/circle-Dm7aG5Ht.js (Deleted) -130 bytes 0 bytes -100.0% 🗑️

@JSONbored
JSONbored merged commit a8a0912 into main Jul 26, 2026
8 checks passed
@JSONbored
JSONbored deleted the feat/rag-embed-preflight branch July 26, 2026 06:18
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.26%. Comparing base (f4c946b) to head (ccc2f37).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
backend 92.93% <100.00%> (-2.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/selfhost/ai.ts 98.26% <100.00%> (+0.01%) ⬆️

... and 3 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

selfhost/rag: boot-time preflight for an embed-capable provider + compose-file RAG hints

1 participant