[kimi] Add unit tests for memory/crud.py (#1344) #1358

Merged
kimi merged 1 commits from kimi/issue-1344 into main 2026-03-24 03:08:37 +00:00

1 Commits

Author SHA1 Message Date
kimi
7fa1d49028 test: add unit tests for memory/crud.py (#1344)
Some checks failed
Tests / lint (pull_request) Failing after 25s
Tests / test (pull_request) Has been skipped
Add comprehensive unit tests covering:
- store_memory: basic, with all fields, with/without embedding
- _build_search_filters: no filters, single/multiple filters
- _fetch_memory_candidates: with data, with limits, with where clause
- _row_to_entry: basic, with metadata, with embedding
- _score_and_filter: empty rows, min relevance, keyword fallback
- search_memories: empty db, returns results, filters, limits
- delete_memory: existing, nonexistent, multiple
- get_memory_stats: empty db, with entries, embedding model status
- prune_memories: empty, old, keeps facts, deletes facts
- get_memory_context: empty, with results, max tokens
- Personal facts: recall, store, with agent filter, with IDs, update
- Reflections: store/recall, replace previous, empty, no reflection
- Edge cases: unicode, special chars, long content, nested metadata

Fixes #1344
2026-03-23 23:07:25 -04:00