[Bounty proposal] fix(backend): Developer API PATCH persists a blank action-item description / conversation title
Symptom
PATCH /v1/dev/user/action-items/{id} with {"description": " "} and PATCH /v1/dev/user/conversations/{id} with {"title": " "} both return HTTP 200 and persist an empty value: the action item's description becomes "", and the conversation's structured.title and user_title both become "". The sibling write paths reject the same input with 422 (POST /v1/dev/user/action-items, PATCH /v1/dev/user/memories/{id}), so only the two update endpoints silently blank a record. Any client can hit it — e.g. omi action-item update ID --description " " or omi conversation update ID --title " " from the Python CLI, or an agent that passes through an empty-ish string.
Evidence
backend/routers/developer.pyUpdateActionItemRequest.description(line 759) andUpdateConversationRequest.title(lines 1123-1125) areOptional[str]withmin_length=1— whitespace satisfiesmin_length.update_action_item(line ~995):update_data['description'] = request.description.strip()with no emptiness check, thenaction_items_db.update_action_item(...).update_conversation_endpoint(line ~2236):conversations_db.update_conversation_title(uid, conversation_id, request.title.strip()), which writesstructured.titleanduser_titleunconditionally (backend/database/conversations.pyline 1092).- Contrast:
create_action_item(line ~855) raises422 "description cannot be empty"onlen(request.description.strip()) == 0;update_memory(line ~705) raises422 "content must not be empty"onnot request.content.strip(). - Reproduced hermetically through the real FastAPI routes with
TestClientand the database seam stubbed: both PATCHes return 200 onmainand call the database update with''.
Proposed Fix
Reject blank text at the request-model boundary, the way UpdateGoalRequest.required_text_cannot_be_null_or_blank already does: one shared helper plus field_validators on UpdateActionItemRequest.description and UpdateConversationRequest.title that return 422 for whitespace-only input and strip surrounding whitespace, while None (field omitted) keeps meaning "leave unchanged". No Firestore write happens for a blank value.
Tests
Regression tests in the existing Developer API harnesses backend/tests/unit/test_dev_api_action_items_poison.py and backend/tests/unit/test_dev_api_conversations_poison.py: a blank body returns 422 and never reaches update_action_item / update_conversation_title; a padded body is stripped before the write. The negative cases fail on main (HTTP 200) and pass with the fix.
Proposed Bounty Reward: $50.00 USD Bounty Payout Destination (PayPal): will be provided by email to [email protected] on payout
cc @josancamon19 @kodjima33