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 && ( <>