From 3246451a1c56b30bfc09339fa7cd65f955b8c63a Mon Sep 17 00:00:00 2001 From: Eric Jurio <1056937+ericnjurio@users.noreply.github.com> Date: Tue, 23 Dec 2025 00:46:25 -0300 Subject: [PATCH] fix(memory): add 'type' to schemas and use passthrough for Gemini CLI compatibility --- src/memory/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/memory/index.ts b/src/memory/index.ts index c7d781d2c4..2d4249537c 100644 --- a/src/memory/index.ts +++ b/src/memory/index.ts @@ -48,12 +48,14 @@ let MEMORY_FILE_PATH: string; // We are storing our memory using entities, relations, and observations in a graph structure export interface Entity { + type?: string; name: string; entityType: string; observations: string[]; } export interface Relation { + type?: string; from: string; to: string; relationType: string; @@ -223,18 +225,20 @@ export class KnowledgeGraphManager { let knowledgeGraphManager: KnowledgeGraphManager; -// Zod schemas for entities and relations +// Zod schemas for entities and relations - Patched for Gemini CLI compatibility const EntitySchema = z.object({ + type: z.string().optional().describe("Internal type discriminator (entity)"), name: z.string().describe("The name of the entity"), entityType: z.string().describe("The type of the entity"), observations: z.array(z.string()).describe("An array of observation contents associated with the entity") -}); +}).passthrough(); const RelationSchema = z.object({ + type: z.string().optional().describe("Internal type discriminator (relation)"), from: z.string().describe("The name of the entity where the relation starts"), to: z.string().describe("The name of the entity where the relation ends"), relationType: z.string().describe("The type of the relation") -}); +}).passthrough(); // The server instance and tools exposed to Claude const server = new McpServer({