Переглянути джерело

tui: fix plan mode switching to prevent duplicate agent switches

Dax Raad 7 місяців тому
батько
коміт
6560f40073

+ 1 - 3
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

@@ -201,9 +201,7 @@ export function Session() {
     if (part.type !== "tool") return
     if (part.sessionID !== route.sessionID) return
     if (part.state.status !== "completed") return
-
-    const metadata = part.state.metadata as { switched?: boolean }
-    if (!metadata?.switched) return
+    if (part.id === lastSwitch) return
 
     if (part.tool === "plan_exit") {
       local.agent.set("build")

+ 1 - 1
packages/opencode/src/tool/plan.ts

@@ -66,7 +66,7 @@ export const PlanExitTool = Tool.define("plan_exit", {
 
     return {
       title: "Switching to build agent",
-      output: "User chose to continue planning. Wait for further instructions.",
+      output: "User approved switching to build agent. Wait for further instructions.",
       metadata: {},
     }
   },