litellm/tests/test_litellm/proxy/memory
Krrish Dholakia be7fe9b5f5 fix(memory): typed Prisma error + explicit-null metadata on PUT
Two more greptile threads from the last review:

- Unique-violation detection was string-matching "Unique"/"UniqueViolation"
  in the exception message, fragile across Prisma/driver versions. Now
  check the typed error `code == "P2002"` first, with string fallback.

- PUT could not distinguish "metadata omitted" from "metadata: null" —
  both parsed as `None`, so callers had no way to clear stored metadata.
  Switch to Pydantic v2's `model_fields_set` to tell which fields the
  caller actually sent; explicit null now clears the column.

New tests:
- explicit null clears metadata
- omitted metadata preserves existing value

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 22:14:11 -07:00
..
__init__.py feat(proxy): add /v1/memory CRUD endpoints with user/team scoping 2026-04-21 20:42:12 -07:00
test_memory_endpoints.py fix(memory): typed Prisma error + explicit-null metadata on PUT 2026-04-23 22:14:11 -07:00