Repository navigation
[ML-69651] [s] Fix AgentKit memory read-mask projections - #582
Open
anshul0713 wants to merge 4 commits into
Open
anshul0713 wants to merge 4 commits into
anshul0713 wants to merge 4 commits into
Conversation
`MemoryStore.list/get/search` accept a `read_mask`, which lets the caller project fields out of the response. `_memory_from_response` hard-indexed `actor_id` and `path`, so a mask that omitted either (e.g. `read_mask="name,content"`) raised `KeyError: 'actor_id'` instead of returning the entry. Read those fields with `.get()` (matching the store parser, which only hard-requires `name`) and mark them Optional on `Memory`, since a read_mask can legitimately leave them absent. Covers list, get, and search (all route through `_memory_from_response`). Test: memory_store_test.py::test_read_mask_projecting_out_fields_does_not_crash. Co-authored-by: Isaac <no-reply@databricks.com>
`ty check` (CI: typechecking for integrations/mason) flagged errors.wrap_api_error: assigning the unwrapped `__cause__` (typed BaseException) to the Exception-typed `exc` parameter is an invalid-assignment. Use a separate BaseException-typed local instead — behavior-identical, and the check now passes. Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MemoryStore.get,list, andsearchcrash withKeyErrorwhen aread_maskomitsactor_idorpath. Parse projected fields as optional and returnNonewhen the service omits them.Keep
namerequired as the resource identity, document including it in read masks, and preserve name-basedid,update, anddelete. OpenAI and LangGraph memory tools use the resource name when a returned entry has no path. Regression coverage includes get, paginated list, scored and legacy search, and projected-entry updates/deletes.This updates the original fix to the current AgentKit implementation and incorporates #747, which is closed as a duplicate. Tracks ML-69651.
Validation at
c2fd79f:301443d; the merge retains both PR histories and produces a six-file diff against current main.