From b62864781d25960214ce761872e7f4d338000afb Mon Sep 17 00:00:00 2001 From: czw333221 <2497710528@qq.com> Date: Sun, 22 Mar 2026 06:09:09 +0800 Subject: [PATCH] fix: part ID must start with 'prt' for OpenCode v1.2.25+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenCode v1.2.25+ validates that part IDs must start with 'prt' prefix. This fixes ZodError: "id field must start with 'prt'" when sending messages. Changes: - `supermemory-nudge-*` → `prt_smnudge_*` - `supermemory-context-*` → `prt_smcontext_*` Fixes: https://github.com/anomalyco/opencode/issues/18205 --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7a5a441..ca9915b 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_smnudge_${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_smcontext_${Date.now()}`, sessionID: input.sessionID, messageID: output.message.id, type: "text",