You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenCode: Cancelling a submit_plan call leaves the review server running, so the next submit_plan fails #1046
When using plannotator with OpenCode, calling submit_plan opens the plan review UI. If the user cancels that tool call with ESC+ESC, the review server keeps running in the background. The next time the agent tries submit_plan, it fails because the port is still occupied.
How to reproduce
Set up plannotator with OpenCode, using a fixed port (e.g., PLANNOTATOR_PORT=4117).
Ask the agent to submit a plan.
When the review UI opens, press ESC+ESC to cancel the tool call.
Ask the agent to submit a plan again.
What the user sees
After step 4, the tool fails with an error saying the port is already in use:
73052 | } else {
73053 | decisionPromise = new Promise(() => {});
73054 | }
73055 | let server2 = null;
73056 | for (let attempt = 1;attempt <= MAX_RETRIES; attempt++) {
73057 | server2 = Bun.serve({
^
error: Failed to start server. Is port 4117 in use?
syscall: "listen",
errno: 0,
code: "EADDRINUSE"
at startPlannotatorServer (/$bunfs/root/plannotator:73057:26)
The agent cannot submit another plan until the stale server is killed manually.
Expected behavior
Cancelling the tool call should stop the review server and free the port, so the next submit_plan succeeds.
Actual behavior
The server from the cancelled review stays alive, blocking all future plan submissions on that port.
Activity