FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(rag): skip the files openRAG declares it cannot index by paultranvan · Pull Request #4937 · linagora/cozy-stack · GitHub

feat(rag): skip the files openRAG declares it cannot index - #4937

Merged
paultranvan merged 2 commits into
masterfrom
feat/skip-unsupported-formats
Sep 29, 2026
Merged

paultranvan merged 2 commits into
masterfrom
feat/skip-unsupported-formats

Conversation

paultranvan commented Sep 23, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

  • Read GET /indexer/supported/types once per rag-index job and skip the files whose extension openRAG does not accept, before the GET on the file and the upload. They get the notsupported status.
  • openRAG answers 415 on those. We met a case for 25k distinct files, mostly node_modules trees (87k .js, 36k .map, 6k .json, 3k LICENSE, 2k .xlsx).
  • The route is optional: on a 404, a 5xx or an unreadable body the job warns and sends every file as before. The list is not cached across jobs.
  • Extension only, no mimetype sent: openRAG picks its parser from the extension and falls back to plain text, so a file accepted on its mimetype would be indexed as noise.
  • The check judges the name sent to openRAG (ragFilename, extracted from resolveContent): a note is judged as .md.
  • A file indexed before its format stopped being accepted stays on openRAG.
  • The walk summary counts unsupported files apart.

paultranvan marked this pull request as draft September 23, 2026 08:08
paultranvan force-pushed the feat/skip-unsupported-formats branch 3 times, most recently from e31aa3b to 96e2b63 Compare September 23, 2026 08:32
paultranvan marked this pull request as ready for review September 23, 2026 08:34
resolveContent decides that name and opens the content in one go, so
nothing could ask for the name alone. Splitting it out keeps the two
renaming rules in a single place, ready for a caller that needs the
name before reading anything.
openRAG answers 415 on an extension its deployment does not accept and
stores nothing, so every run sent the file again. One Drive walked on
2026-09-22 made about 147k refused POSTs for 25k distinct files, mostly
node_modules trees (87k .js, 36k .map, 6k .json, 3k LICENSE, 2k .xlsx),
each with a GET and a full upload for nothing.

Read GET /indexer/supported/types once per job and skip those files
before any request. The route is optional: on any failure the job warns
and sends every file as before. Extension only, no mimetype sent:
openRAG picks its parser from the extension and falls back to plain
text, so a file accepted on its mimetype would be indexed as noise.
paultranvan force-pushed the feat/skip-unsupported-formats branch from 96e2b63 to 6a35c48 Compare September 29, 2026 14:55
Comment thread model/rag/index.go
if err := SetIndexStatus(ctx.inst, f.ID, StatusNotSupported, f.Rev); err != nil {
return err
}
return errUnsupportedFormat

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

when we are moving file from one workspace to another, and in the second one it's nop supported, it will be still indexed in the firs one

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That's quite a good catch. I think this situation is quite unlikely in practice, as all the workspace will have the same supported files.
We could however have this situation: file1.txt is renamed file1.xyz (not supported), and then moved to another workspace: we'll still have file1.txt in first workspace.
We can fix it, but I think it's not worth the effort for now: it's not a common situation, and I prefer we put effort on a future rabbitmq indexer instead, outside of cozy-stack. I'll make an issue about that so we don't forget

paultranvan merged commit 8a4c46e into master Sep 29, 2026
4 checks passed
paultranvan deleted the feat/skip-unsupported-formats branch September 29, 2026 15:58
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL