diff --git a/frontend/src/hooks/useTaskDetails.ts b/frontend/src/hooks/useTaskDetails.ts index 2bcfa417..6965f10c 100644 --- a/frontend/src/hooks/useTaskDetails.ts +++ b/frontend/src/hooks/useTaskDetails.ts @@ -17,6 +17,7 @@ export function useTaskDetails( projectId: string, isOpen: boolean ) { + const { config } = useConfig(); const [taskAttempts, setTaskAttempts] = useState([]); const [selectedAttempt, setSelectedAttempt] = useState( null @@ -31,7 +32,9 @@ export function useTaskDetails( runningProcessDetails: {}, }); const [loading, setLoading] = useState(false); - const [selectedExecutor, setSelectedExecutor] = useState('claude'); + const [selectedExecutor, setSelectedExecutor] = useState( + config?.executor.type || 'claude' + ); const [isStopping, setIsStopping] = useState(false); const [followUpMessage, setFollowUpMessage] = useState(''); const [isSendingFollowUp, setIsSendingFollowUp] = useState(false); @@ -43,8 +46,6 @@ export function useTaskDetails( const [branches, setBranches] = useState([]); const [selectedBranch, setSelectedBranch] = useState(null); - const { config } = useConfig(); - // Find running dev server in current project const runningDevServer = useMemo(() => { return attemptData.processes.find( @@ -267,10 +268,10 @@ export function useTaskDetails( // Set default executor from config useEffect(() => { - if (config) { + if (config && config.executor.type !== selectedExecutor) { setSelectedExecutor(config.executor.type); } - }, [config]); + }, [config, selectedExecutor]); useEffect(() => { if (task && isOpen) {