Repository navigation
fix(collections): Normalize file extension case - #1193
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
OpenAPI changes ⚪ No API surface changesNote This PR does not modify the API contract.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
A knowledge base document uploaded as `report.PDF` is accepted at upload — `get_file_format` lowercases the suffix — and `fname` is stored with its original case, since it drives the download attachment name. OpenAI file search may not match an uppercase suffix in every ingestion path, and a failed file in a batch is a hard failure that rolls back the whole vector store. Send `files.create` the stem plus a lowercased extension; the stored `fname` is untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
0641588 to
8d462dd
Compare
Use string rsplit instead of pathlib import. Same pattern already in codebase (stt_evaluations/audio.py). Clear variable names: filename + extension.
c8c84ba to
5baeeee
Compare
The two upload_files filename tests differed only in input/expected, so collapse them and add the extensionless case, which had no coverage. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
🎉 This PR is included in version 1.6.1-main.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Issue
Closes #1196
Summary
A knowledge base document uploaded as
report.PDFis accepted at upload —get_file_formatlowercases the suffix — andfnameis stored with its original case, since it drives the download attachment name.upload_filesthen handed that name tofiles.createverbatim, so an uppercase suffix reached the provider.OpenAI file search may not match an uppercase suffix in every ingestion path, and a failed file in a batch is a hard failure that rolls back the whole vector store — so one such document can take an entire collection job down rather than failing alone.
files.createreceives the stem plus a lowercased extension. The storedfnameis untouched, so download attachment names keep their original case.docs/wiki/modules/knowledge-base.mdunder Gotchas.Notes
collection_job.error_messagewere described in an earlier revision of this description but are not part of this diff. This PR is the case-normalization fix only.report.pdf→report.pdf,Report.PDF→Report.pdf, and the extensionlessREADME→README, which had no coverage before.Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.