Skip to content

Commit a01e90a

Browse files
backnotpropclaude
andcommitted
Fix agent switching: fire-and-forget session.prompt
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 <noreply@anthropic.com>
1 parent d19b56b commit a01e90a

5 files changed

Lines changed: 14 additions & 19 deletions

File tree

apps/opencode-plugin/index.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,15 @@ Do NOT proceed with implementation until your plan is approved.
7979
// Silently fail
8080
}
8181

82-
// Send a new message with build agent - this queues a new loop
83-
try {
84-
await ctx.client.session.prompt({
85-
path: { id: context.sessionID },
86-
body: {
87-
agent: "build",
88-
parts: [{ type: "text", text: "Proceed with implementation" }],
89-
},
90-
});
91-
} catch {
92-
// Silently fail
93-
}
82+
// Send a new message with build agent - fire and forget (don't await)
83+
// Awaiting can cause the message to be queued instead of processed
84+
ctx.client.session.prompt({
85+
path: { id: context.sessionID },
86+
body: {
87+
agent: "build",
88+
parts: [{ type: "text", text: "Proceed with implementation" }],
89+
},
90+
}).catch(() => {});
9491

9592
return `Plan approved!
9693

apps/opencode-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@plannotator/opencode",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"description": "Plannotator plugin for OpenCode - interactive plan review with visual annotation",
55
"author": "backnotprop",
66
"license": "BSL-1.1",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plannotator",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"private": true,
55
"description": "Interactive Plan Review for Claude Code - annotate plans visually, share with team, automatically send feedback",
66
"author": "backnotprop",

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@plannotator/server",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"private": true,
55
"description": "Shared server implementation for Plannotator plugins",
66
"main": "index.ts",

tests/opencode-local/opencode.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"plugin": [
3-
"@plannotator/opencode@beta"
4-
],
2+
"plugin": ["@plannotator/opencode@latest"],
53
"$schema": "https://opencode.ai/config.json"
6-
}
4+
}

0 commit comments

Comments
 (0)