Skip to content

Commit 373e1d8

Browse files
backnotpropclaude
andcommitted
Fix OpenCode agent switching race condition + adjust UI width
Agent switching: - Use noReply: true with await to ensure user message is created before returning from tool - Fixes race condition where message was created after loop exited UI: - Adjust plan viewer width to 832px (between 3xl and 4xl) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bc64836 commit 373e1d8

9 files changed

Lines changed: 25 additions & 18 deletions

File tree

apps/hook/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "plannotator",
33
"description": "Interactive Plan Review: Mark up and refine your plans using a UI, easily share for team collaboration, automatically integrates with plan mode hooks.",
4-
"version": "0.4.6",
4+
"version": "0.4.7",
55
"author": {
66
"name": "backnotprop"
77
},

apps/opencode-plugin/index.ts

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

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(() => {});
82+
// Create a user message with build agent using noReply: true
83+
// This ensures the message is created BEFORE we return from the tool,
84+
// so the current loop's next iteration will see it.
85+
// noReply: true means we don't wait for a new loop to complete.
86+
try {
87+
await ctx.client.session.prompt({
88+
path: { id: context.sessionID },
89+
body: {
90+
agent: "build",
91+
noReply: true,
92+
parts: [{ type: "text", text: "Proceed with implementation" }],
93+
},
94+
});
95+
} catch {
96+
// Silently fail if session is busy
97+
}
9198

9299
return `Plan approved!
93100

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.6",
3+
"version": "0.4.7",
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.6",
3+
"version": "0.4.7",
44
"private": true,
55
"description": "Interactive Plan Review for Claude Code - annotate plans visually, share with team, automatically send feedback",
66
"author": "backnotprop",

packages/editor/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ const App: React.FC = () => {
636636
<main className="flex-1 overflow-y-auto bg-grid">
637637
<div className="min-h-full flex flex-col items-center px-4 py-3 md:px-10 md:py-8 xl:px-16">
638638
{/* Mode Switcher */}
639-
<div className="w-full max-w-4xl 2xl:max-w-5xl mb-3 md:mb-4 flex justify-start">
639+
<div className="w-full max-w-[832px] 2xl:max-w-5xl mb-3 md:mb-4 flex justify-start">
640640
<ModeSwitcher mode={editorMode} onChange={setEditorMode} taterMode={taterMode} />
641641
</div>
642642

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.6",
3+
"version": "0.4.7",
44
"private": true,
55
"description": "Shared server implementation for Plannotator plugins",
66
"main": "index.ts",

packages/ui/components/DecisionBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const DecisionBar: React.FC<DecisionBarProps> = ({
8585

8686
return (
8787
<div className="fixed bottom-0 left-0 right-0 p-4 bg-card/95 backdrop-blur-xl border-t border-border z-50">
88-
<div className="max-w-4xl 2xl:max-w-5xl mx-auto flex items-center gap-4">
88+
<div className="max-w-[832px] 2xl:max-w-5xl mx-auto flex items-center gap-4">
8989
{/* Status info */}
9090
<div className="flex-1 text-sm text-muted-foreground">
9191
{annotationCount > 0 ? (

packages/ui/components/Viewer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,11 @@ export const Viewer = forwardRef<ViewerHandle, ViewerProps>(({
517517
};
518518

519519
return (
520-
<div className="relative z-50 w-full max-w-4xl 2xl:max-w-5xl">
520+
<div className="relative z-50 w-full max-w-[832px] 2xl:max-w-5xl">
521521
{taterMode && <TaterSpriteSitting />}
522522
<article
523523
ref={containerRef}
524-
className="w-full max-w-4xl 2xl:max-w-5xl bg-card border border-border/50 rounded-xl shadow-xl p-5 md:p-8 lg:p-10 xl:p-12 relative"
524+
className="w-full max-w-[832px] 2xl:max-w-5xl bg-card border border-border/50 rounded-xl shadow-xl p-5 md:p-8 lg:p-10 xl:p-12 relative"
525525
>
526526
{/* Header buttons */}
527527
<div className="absolute top-3 right-3 md:top-5 md:right-5 flex items-start gap-2">

tests/opencode-local/opencode.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"plugin": ["@plannotator/opencode@latest"],
2+
"plugin": ["@plannotator/opencode@beta"],
33
"$schema": "https://opencode.ai/config.json"
44
}

0 commit comments

Comments
 (0)