File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
frontend/app/[locale]/setup/agentSetup/components Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -206,17 +206,10 @@ export default function DebugConfig({
206206 setMessages ( [ ] ) ;
207207 // Reset step ID counter
208208 stepIdCounter . current . current = 0 ;
209- // Stop any ongoing debug run
210- if ( abortControllerRef . current ) {
211- abortControllerRef . current . abort ( ) ;
212- abortControllerRef . current = null ;
213- }
214- // Reset streaming state
215- setIsStreaming ( false ) ;
216- // Clear timeout timer
217- if ( timeoutRef . current ) {
218- clearTimeout ( timeoutRef . current ) ;
219- timeoutRef . current = null ;
209+ // Stop both frontend and backend when switching agent (debug mode)
210+ const hasActiveStream = isStreaming || abortControllerRef . current !== null ;
211+ if ( hasActiveStream ) {
212+ handleStop ( ) ;
220213 }
221214 } , [ agentId ] ) ;
222215
You can’t perform that action at this time.
0 commit comments