Repository navigation
fix(platform): gate RAG queueing on a shared indexability allowlist - #1853
Conversation
Chat and connector uploads queued every non-audio file for RAG indexing, including formats the RAG service deterministically rejects with HTTP 400 (legacy Office .doc/.xls/.ppt, misc text extensions) — surfacing as a permanent "Index failed" badge that users read as broken DOCX/XLSX support. Non-indexable formats now skip the queue entirely (the audio pattern: ragStatus stays undefined) and remain usable inline in chat. - add RAG_INDEXABLE_EXTENSIONS + isRagIndexableFile to lib/shared/file-types as the platform-side mirror of RAG's allowlist - derive RAG's SUPPORTED_EXTENSIONS from the extraction router's capability set minus an explicit SENSITIVE_EXTENSIONS (.env/.log) exclusion, fixing the .tif drift while preserving the secret-bearing-format posture - enforce two-way parity in test_extension_sync.py (new reverse-parity test) - store the RAG response detail (UpstreamHttpError.bodySnippet, already secret-scrubbed) in ragError instead of a bare "returned HTTP 400." - fall back to the exception class name in _sanitize_error so failures never land as an empty error string - surface ragError as a tooltip on the chat "Index failed" badge - clear stale failed RAG state when a non-indexable file is re-uploaded - update the Documents docs format list (en/de/fr) to match the pipeline
|
Warning Review limit reached
More reviews will be available in 44 minutes and 46 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (16)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What / why
Closes #1522.
Genuine
.docx/.xlsxare supported end-to-end by the RAG indexer. The deterministic bug behind the "Index failed" reports is an allowlist gap: the platform accepts formats the RAG service rejects (legacy Office.doc/.xls/.pptplus misc text extensions), force-queues them for indexing, and RAG's HTTP 400 lands as a permanent Index failed badge — which users read as broken Word/Excel support. (The original.docx/.xlsxreports most likely date to the embedding-credentials bug already fixed in #1476.)Changes
RAG_INDEXABLE_EXTENSIONS+isRagIndexableFile()inlib/shared/file-types.tsmirror RAG'sSUPPORTED_EXTENSIONS. BothsaveFileMetadatavariants (chat upload + connectors/documents) only queue RAG indexing when the format is indexable; non-indexable files keepragStatusundefined (the existing audio pattern), show no badge in the composer, show Not indexed in the Document Hub, and stay fully usable inline in chat (.xlsis parsed by the platform-side Excel parser, text files are inlined).SUPPORTED_EXTENSIONSinapp/routers/documents.pyis now derived from the extraction router'sALL_SUPPORTED_EXTENSIONSminus an explicitSENSITIVE_EXTENSIONS(.env,.log) exclusion — fixing the.tifdrift (extractor-supported, route-rejected) while preserving the deliberate secret-bearing-format posture thattest_document_helpers.py/test_secret_scanner.pyenforce.test_extension_sync.pynow imports the live Python set (instead of regex-on-source) and adds a reverse-parity test assertingRAG_INDEXABLE_EXTENSIONSequals RAG's set exactly, so the lists can never drift again.uploadFileToRagstores the upstream response detail (UpstreamHttpError.bodySnippet, already truncated + secret-scrubbed) inragErrorinstead of an unactionable "returned HTTP 400."; RAG's_sanitize_errorfalls back to the exception class name whenstr(exc)is empty so failures never surface as "Unknown error".ragErroras a tooltip (title), matching the Document Hub which already shows the reason.ragStatus: 'failed'/ragErrorleft by the pre-allowlist era, so stuck badges self-heal.platform/knowledge/documents.md(en/de/fr) to match the pipeline (removed never-supported.odt/.rtf/.ods/.odp) and documented the new not-indexed behavior for out-of-list formats.Decision-gate recommendations baked in
.env,.log) deliberately stay unindexed — encoded asSENSITIVE_EXTENSIONSrather than silently re-enabled by the derivation..doc/.xls/.pptconversion added to RAG); adding real legacy-Office support remains a possible follow-up issue.Coordination
#1498's agent is migrating the
xlsxdependency to the SheetJS CDN tarball in parallel; this PR deliberately does not touch thexlsxdependency or the platform-side Excel parse path beyond the queue gating.Verification
Performed:
bun run checkat the repo root — all 40 turbo tasks green (format, lint, typecheck, 71 921 platform tests incl. the newisRagIndexableFile/ queue-gating cases).cd services/rag && uv run pytest— 320 passed (incl. new reverse-parity,_sanitize_errorfallback, and the updated secret-posture tests asserting on the imported set).bun run --filter @tale/docs lintandbun run --filter @tale/docs test— green.Manual verification required (needs a running stack / the reporter's deployment):
.docx/.xlsxin chat → "Indexed"; upload.doc/.xls→ no badge, spreadsheet content still usable in chat; stop the rag container and upload a.docx→ badge appears with the failure reason visible on hover.SELECT filename, status, error FROM private_knowledge.documents WHERE status='failed' ORDER BY updated_at DESC LIMIT 5;to confirm no residual.docx/.xlsxfailure exists post-fix(rag): use correct provider credentials and support local dev config sync #1476 (if errors show embedding-auth, it is a deployment/provider-config issue, not code).Known limitation (follow-up candidate): the Document Hub Index retry button on a non-indexable file will still 400 → failed; with the improved
ragErrorthe dialog now shows the real reason.retryRagIndexingcould early-return using the same helper.Pre-PR checklist
bun run check(format, lint, typecheck, all tests).h-[…]on skeletons — N/A (no loading states touched).services/platform/messages/{en,de,fr}.json— N/A (no new keys; tooltip shows the raw stored error, existingindexingFailedlabel reused)./docs/{en,de,fr}/for every user-visible change.bun run --filter @tale/docs lintandbun run --filter @tale/docs test.README.md,README.de.md,README.fr.md— N/A.