omi icon indicating copy to clipboard operation
omi copied to clipboard

[Bounty proposal] fix(mcp): handle null content on locked memories ($50-100 proposed)

Open kduailabs opened this issue 2 months ago • 5 comments

Problem

When a memory record has content: None in Firestore and is_locked: True, MCP endpoints that truncate locked memory content crash with TypeError: object of type 'NoneType' has no len():

  1. GET /v1/mcp/memories (REST): Iterating over memories evaluates content = memory.get('content', ''). If 'content': None is present in the record dict, the default '' is not applied. memory['content'] = (content[:70] + '...') if len(content) > 70 else content crashes on len(None) with TypeError, failing the endpoint with 500.

  2. execute_tool("get_memories") (SSE MCP tool): Lines 1040-1043 of backend/routers/mcp_sse.py apply identical truncation on result["memories"], crashing the tool execution loop with unhandled TypeError.

Fix & PR

PR #16034 applies memory.get('content') or '' across backend/routers/mcp.py and backend/routers/mcp_sse.py, and adds regression tests covering both surfaces in backend/tests/unit/test_mcp_data_endpoints.py.

Proposed Bounty: $50-100

kduailabs avatar Sep 22 '26 23:09 kduailabs

Claiming this proposal. Implementing null-safe truncation for locked memory content + tests.

Payout (PayPal): [email protected]

Ljunqiang avatar Sep 23 '26 08:09 Ljunqiang

Standing down this claim — the proposal body already points at solution PR #16034 (@kduailabs, open). Not competing with an existing delivery. PayPal claim withdrawn for this issue.

Ljunqiang avatar Sep 23 '26 08:09 Ljunqiang

Greetings, I'm Atlas (AI). I've analyzed this issue and would like to propose a fix.

Preliminary Analysis:

Problem

When a memory record has content: None in Firestore and is_locked: True, MCP endpoints that truncate locked memory content crash with `TypeError: object of type 'NoneType' has no len()...

I'm ready to begin implementation immediately to ensure a high-quality, tested resolution. Assigning this to me will trigger my automated development loop.

[bounty-hunter-claim]

jmy126 avatar Sep 23 '26 12:09 jmy126

[bounty-hunter-release] Update: the bot cannot complete this task reliably under current constraints, so this claim is being released to avoid blocking others.

Reason: tests_failed_after_retries

jmy126 avatar Sep 23 '26 12:09 jmy126

Closing as completed — resolved via merged PR #16034 and claimed via Zendesk Ticket #135514261.

kduailabs avatar Sep 26 '26 13:09 kduailabs