From b546bf9b9d8377f82bf0edc45ef9f85fa04cf444 Mon Sep 17 00:00:00 2001 From: Michael Ramos Date: Tue, 6 Jan 2026 15:07:19 -0800 Subject: [PATCH] Fix agent switching: fire-and-forget session.prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't await session.prompt to avoid queuing issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/opencode-plugin/index.ts | 21 +++++++++------------ apps/opencode-plugin/package.json | 2 +- package.json | 2 +- packages/server/package.json | 2 +- tests/opencode-local/opencode.json | 6 ++---- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/apps/opencode-plugin/index.ts b/apps/opencode-plugin/index.ts index c20cedd..d248f0e 100644 --- a/apps/opencode-plugin/index.ts +++ b/apps/opencode-plugin/index.ts @@ -79,18 +79,15 @@ Do NOT proceed with implementation until your plan is approved. // Silently fail } - // Send a new message with build agent - this queues a new loop - try { - await ctx.client.session.prompt({ - path: { id: context.sessionID }, - body: { - agent: "build", - parts: [{ type: "text", text: "Proceed with implementation" }], - }, - }); - } catch { - // Silently fail - } + // Send a new message with build agent - fire and forget (don't await) + // Awaiting can cause the message to be queued instead of processed + ctx.client.session.prompt({ + path: { id: context.sessionID }, + body: { + agent: "build", + parts: [{ type: "text", text: "Proceed with implementation" }], + }, + }).catch(() => {}); return `Plan approved! diff --git a/apps/opencode-plugin/package.json b/apps/opencode-plugin/package.json index a68c157..5be431c 100644 --- a/apps/opencode-plugin/package.json +++ b/apps/opencode-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@plannotator/opencode", - "version": "0.4.3", + "version": "0.4.4", "description": "Plannotator plugin for OpenCode - interactive plan review with visual annotation", "author": "backnotprop", "license": "BSL-1.1", diff --git a/package.json b/package.json index 9de3b4b..1642c34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plannotator", - "version": "0.4.3", + "version": "0.4.4", "private": true, "description": "Interactive Plan Review for Claude Code - annotate plans visually, share with team, automatically send feedback", "author": "backnotprop", diff --git a/packages/server/package.json b/packages/server/package.json index 02f1f82..39bac87 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@plannotator/server", - "version": "0.4.3", + "version": "0.4.4", "private": true, "description": "Shared server implementation for Plannotator plugins", "main": "index.ts", diff --git a/tests/opencode-local/opencode.json b/tests/opencode-local/opencode.json index 590eee9..b89b74f 100644 --- a/tests/opencode-local/opencode.json +++ b/tests/opencode-local/opencode.json @@ -1,6 +1,4 @@ { - "plugin": [ - "@plannotator/opencode@beta" - ], + "plugin": ["@plannotator/opencode@latest"], "$schema": "https://opencode.ai/config.json" -} \ No newline at end of file +} -- knotmirror 0.0.1