fix: unintended tear down of agent loop (#483)

fixes #465
This commit is contained in:
Mitchell Kutchuk
2025-04-21 15:01:09 -04:00
committed by GitHub
parent f72cfd7ef3
commit 09f0ae3899

View File

@@ -305,15 +305,10 @@ export default function TerminalChat({
agentRef.current = undefined; agentRef.current = undefined;
forceUpdate(); // rerender after teardown too forceUpdate(); // rerender after teardown too
}; };
}, [ // We intentionally omit 'approvalPolicy' and 'confirmationPrompt' from the deps
model, // so switching modes or showing confirmation dialogs doesnt tear down the loop.
provider, // eslint-disable-next-line react-hooks/exhaustive-deps
config, }, [model, provider, config, requestConfirmation, additionalWritableRoots]);
approvalPolicy,
confirmationPrompt,
requestConfirmation,
additionalWritableRoots,
]);
// Whenever loading starts/stops, reset or start a timer — but pause the // Whenever loading starts/stops, reset or start a timer — but pause the
// timer while a confirmation overlay is displayed so we don't trigger a // timer while a confirmation overlay is displayed so we don't trigger a