Repository navigation
Python: Fix in-memory UUID key lookup and deletion - #9061
Zhibo Lin (LE0-Lin) wants to merge 1 commit into
Conversation
Signed-off-by: Zhibo Lin <147509942+LE0-Lin@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation aligns lookup keys with stored serialization and includes adequate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes UUID-keyed record retrieval and deletion in the Python in-memory vector store.
Changes:
- Normalizes native UUID lookup and deletion keys to serialized strings.
- Adds regression tests for UUID/string keys, ordering, missing keys, and deletion isolation.
| File | Description |
|---|---|
python/packages/core/agent_framework/_in_memory.py |
Normalizes UUID keys during get and delete operations. |
python/packages/core/tests/core/test_in_memory.py |
Adds UUID retrieval and deletion regression coverage. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Codex-assisted CI follow-up for head The job reports 1 failed, 18,084 passed, 37 skipped, 2 xfailed. The other nine completed OS/Python test jobs passed; Python 3.15/Linux was cancelled. Quality, coverage, and the executed integration checks passed. This failure is in the AG-UI endpoint test, outside the two changed in-memory UUID files. The short timeout suggests a possible scheduling race, but I have not confirmed the cause through a rerun. Could a maintainer rerun the failed Windows/Python 3.12 and cancelled Linux/Python 3.15 test jobs, then refresh
|
Motivation & Context
UUID-keyed records can be inserted into
InMemoryCollection, but querying with the model's UUID returns no record and deleting with it silently leaves the record stored. Shared serialization stores the UUID as a string; the lookup operations need to use the same representation.Description & Review Guide
On unchanged production code the native UUID cases fail and the string controls pass (2 failed / 2 passed). With the patch,
test_in_memory.pyandtest_vectors.pypass together (419 passed), including the existing UUID JSON-tool test. Ruff 0.16.10 lint/format, strict source Pyright and the five upstream test-typing configurations pass on the changed files. The full workspace and remote integrations have not been run.Codex assisted reproduction, implementation, tests, and PR preparation. No independent human execution or review is claimed. This draft is ready for review of the small fix; upstream CI and maintainer acceptance remain pending.
Related Issue
Fixes #9060
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.