From ac0294f5eedcd6a238abd658a9f1e48ef850ba31 Mon Sep 17 00:00:00 2001 From: NevermoreDDD <58871447+NevermoreDDD@users.noreply.github.com> Date: Sun, 15 Mar 2026 15:01:16 +0800 Subject: [PATCH] fix: add prt_ prefix to part IDs for OpenCode 1.2.25+ compatibility OpenCode 1.2.25+ validates part IDs with Zod schema requiring 'prt' prefix. The chat.message hook was creating parts with non-compliant IDs causing ZodError. Fixes #29 --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7a5a441..fecd624 100644 --- a/src/index.ts +++ b/src/index.ts @@ -112,7 +112,7 @@ export const SupermemoryPlugin: Plugin = async (ctx: PluginInput) => { if (detectMemoryKeyword(userMessage)) { log("chat.message: memory keyword detected"); const nudgePart: Part = { - id: `supermemory-nudge-${Date.now()}`, + id: `prt_supermemory-nudge-${Date.now()}`, sessionID: input.sessionID, messageID: output.message.id, type: "text", @@ -157,7 +157,7 @@ export const SupermemoryPlugin: Plugin = async (ctx: PluginInput) => { if (memoryContext) { const contextPart: Part = { - id: `supermemory-context-${Date.now()}`, + id: `prt_supermemory-context-${Date.now()}`, sessionID: input.sessionID, messageID: output.message.id, type: "text",