From 6a1ec26f997ced3b61c15b9464dd09d28f0fd130 Mon Sep 17 00:00:00 2001 From: Brydon DeWitt Date: Wed, 10 Jun 2026 00:03:03 -0400 Subject: [PATCH] fix: opencode plugin broken after version upgrade --- .agents/frameworks/opencode/plugin.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.agents/frameworks/opencode/plugin.ts b/.agents/frameworks/opencode/plugin.ts index 47ffd1a..d8d16d2 100644 --- a/.agents/frameworks/opencode/plugin.ts +++ b/.agents/frameworks/opencode/plugin.ts @@ -48,6 +48,9 @@ export const GlobalPlugin: Plugin = async ({ $, client }) => { 'chat.message': async (input, output) => { logInfoData('chat.message', { input, output }); + const sessionID = output.message.sessionID; + const messageID = output.message.id; + // Session-start injection — runs exactly once per session, prepended so it // reads before the user-prompt-submit nudges on the first turn. if (!initializedSessions.has(input.sessionID)) { @@ -57,8 +60,8 @@ export const GlobalPlugin: Plugin = async ({ $, client }) => { if (startContext) { output.parts.unshift({ id: `prt_${crypto.randomUUID()}`, - sessionID: input.sessionID, - messageID: input.messageID ?? crypto.randomUUID(), + sessionID, + messageID, type: 'text', text: startContext, synthetic: true, @@ -78,8 +81,8 @@ export const GlobalPlugin: Plugin = async ({ $, client }) => { if (context) { output.parts.push({ id: `prt_${crypto.randomUUID()}`, - sessionID: input.sessionID, - messageID: input.messageID ?? crypto.randomUUID(), + sessionID, + messageID, type: 'text', text: context, synthetic: true,