Upstream contribution · tigerless-labs/agent-memory
agent-memory · Validate a new embedding before replacing a cached projection
Problem
A malformed embedding response could cause agent-memory to discard its previous dense projection. That turned an invalid refresh into the loss of usable cached data.
Engineering response
Validate vector shape and finite values, then pack the complete candidate before swapping it in. Malformed input leaves the previous projection available.
Evidence and scope
The PR reports a baseline regression failure and passing isolated runtime tests and lint after the fix. The record also notes a separate pre-existing mypy diagnostic.