From 58d7b6d680477d98db5115bf940eecefef817a4b Mon Sep 17 00:00:00 2001 From: Logan Yang Date: Sun, 3 Aug 2025 17:29:59 -0700 Subject: [PATCH] Turn off agent when in Projects mode (#1686) --- src/components/chat-components/ChatInput.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/chat-components/ChatInput.tsx b/src/components/chat-components/ChatInput.tsx index 7f5d88eb..0c8d9a25 100644 --- a/src/components/chat-components/ChatInput.tsx +++ b/src/components/chat-components/ChatInput.tsx @@ -131,10 +131,16 @@ const ChatInput = forwardRef<{ focus: () => void }, ChatInputProps>( }, })); - // Sync autonomous agent toggle with settings + // Sync autonomous agent toggle with settings and chain type useEffect(() => { - setAutonomousAgentToggle(settings.enableAutonomousAgent); - }, [settings.enableAutonomousAgent]); + if (currentChain === ChainType.PROJECT_CHAIN) { + // Force off in Projects mode + setAutonomousAgentToggle(false); + } else { + // In other modes, use the actual settings value + setAutonomousAgentToggle(settings.enableAutonomousAgent); + } + }, [settings.enableAutonomousAgent, currentChain]); useEffect(() => { if (currentChain === ChainType.PROJECT_CHAIN) { @@ -596,8 +602,8 @@ const ChatInput = forwardRef<{ focus: () => void }, ChatInputProps>( ) : ( <> - {/* Autonomous Agent button - only show in Copilot Plus mode */} - {isCopilotPlus && ( + {/* Autonomous Agent button - only show in Copilot Plus mode and NOT in Projects mode */} + {isCopilotPlus && currentChain !== ChainType.PROJECT_CHAIN && ( )} - {/* Toggle buttons for vault, web search, and composer - only show when Autonomous Agent is off */} + {/* Toggle buttons for vault, web search, and composer - show when Autonomous Agent is off */} {!autonomousAgentToggle && isCopilotPlus && ( <>