[Bounty proposal] fix(edit-tools): guard None configurable and null string parameters in chat edit tools ($50 proposed)
Summary
In backend/utils/retrieval/tools/edit_tools.py, domain mutation tools (update_conversation, rename_person, edit_memory, delete_memory) allow users and agents to update conversation metadata, rename contacts, and edit/delete stored memories.
Runtime Crashes & Vulnerabilities
-
Fatal
AttributeError: 'NoneType' object has no attribute 'get'inowner(config): At line 22:def owner(config): config = config or {} uid = config.get('configurable', {}).get('user_id') if not uid: raise PermissionError('Authenticated owner required') return uidWhen
configis a dictionary containing'configurable': None(common in LangChain runnable configurations whenconfigurableis uninitialized),config.get('configurable', {})returnsNone. Calling.get('user_id')onNoneraises an unhandledAttributeError, failing every single tool inedit_tools.py. -
AttributeError: 'NoneType' object has no attribute 'strip'inupdate_conversation(): At line 58:if not correction.strip() or len(correction) > 2000 or (title is None and overview is None):If a tool call passes
correction=None(e.g. updating title or overview without explicit correction note),.strip()crashes immediately withAttributeError. -
AttributeError: 'NoneType' object has no attribute 'strip'inedit_memory(): At line 118:if not content.strip() or len(content) > 20000:If
contentisNone,.strip()crashes withAttributeError. -
Missing validation on
nameinrename_person(): Ifnameis empty orNone, it is passed directly intomcp_people.rename_person()without early input validation.
Fix
- In
owner(config), safely extractconfigurableanduser_idsupporting both nestedconfigurableand top-leveluser_id, raisingPermissionError('Authenticated owner required')if invalid. - Ensure
config.get('configurable') or {}is passed intoresolve_edit_ref(). - Defensively validate
correction,content, andnameagainstNonebefore calling.strip(). - Add comprehensive hermetic unit tests in
backend/tests/unit/test_edit_tools.py.
Bounty Proposal
- Proposed tier: $50 (Targeted bug fix + unit test coverage)
- Settlement: Base Mainnet USDC / Stripe / Singapore Card
Resolved in PR #23134.
Added _extract_configurable helper to guard against {'configurable': None}, supported top-level/nested user_id resolution, added defensive null/whitespace checks for correction, name, and content, and added full unit test coverage (10/10 passing) in backend/tests/unit/test_edit_tools.py.
Payout address (Base USDC): 0xb95e2AD8E9D9e9BF902c7531577Cd0E1ceB203D4
Thanks for putting this together. We aren't doing bounties at the moment, so we're closing the bounty proposal issues for now — thanks for the fix! 🙏