[Bounty Proposal] fix(chat): send path 500s on a malformed stored attachment ($25-50 proposed)
Author: kduailabsCreated Sep 28, 2026Updated Sep 28, 2026
Summary
The chat send path (POST /v2/messages, routers/chat.py::send_message) still built attachments with a raw [FileChat(**f) for f in files] comprehension over chat_db.get_chat_files. The merged hardening #9608 moved the other three builders onto _safe_file_chats, so a legacy/partial file doc (missing openai_file_id/mime_type/created_at) now 500s only this remaining site — before the turn is persisted.
Impact
- A client-supplied
file_idsentry pointing at a partial stored doc makes the whole send fail with a 500. - Same class as #9608; one site missed.
Fix
Use _safe_file_chats (skips the malformed record, logs it) in the send path.
PR
https://github.com/BasedHardware/omi/pull/19560
Tests
backend/tests/unit/test_chat_send_malformed_file_guard.py (source ratchet) + the existing test_chat_file_skip_malformed.py helper coverage.
Proposing US$25–50 (single remaining site of a merged fix).
Source: BasedHardware/omi