fix(memory): allow additional properties in entity/relation schemas#3161
fix(memory): allow additional properties in entity/relation schemas#3161majiayu000 wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Added .passthrough() to EntitySchema and RelationSchema to allow entities with extra properties to be read without schema validation errors. This fixes the issue where read_graph fails when the stored memory.jsonl contains entities with non-standard properties. Fixes modelcontextprotocol#3144 Signed-off-by: majiayu000 <1835304752@qq.com>
|
The issue is not resolved |
|
@NeverMore93 I've tested this fix and verified it works correctly. Here's my analysis: Root Cause:
Test Results: Could you share more details about your test environment?
This will help identify if there's a version-specific issue or a different scenario not covered by this fix. |
|
Thanks for the fix and the clear reproduction — this was a real issue! The underlying bug has already been fixed, just at a different layer. Commit 8af50b9418 ("remove type from loading") on 2026-01-14 rewrote Your new test actually passes on current main without the Because Closing on that basis — thanks for the contribution! (Triaged with help from Claude Code.) |
Summary
.passthrough()toEntitySchemaandRelationSchemaProblem
When
memory.jsonlcontains entities with extra properties (e.g.,custom_id), theread_graphtool fails with:Solution
Using Zod's
.passthrough()allows the schema to accept additional properties while still validating required fields.Fixes #3144