Skip to content

Commit c137ba6

Browse files
committed
🐛fix: stop backend
1 parent 0130718 commit c137ba6

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

frontend/app/[locale]/setup/agentSetup/components/DebugConfig.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)