mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
tui: fix plan mode switching to prevent duplicate agent switches
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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: {},
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user