tui: fix plan mode switching to prevent duplicate agent switches

This commit is contained in:
Dax Raad
2026-01-13 15:34:57 -05:00
parent 69795efdcd
commit 6560f40073
2 changed files with 2 additions and 4 deletions

View File

@@ -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")

View File

@@ -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: {},
}
},