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;
forceUpdate(); // rerender after teardown too
};
}, [
model,
provider,
config,
approvalPolicy,
confirmationPrompt,
requestConfirmation,
additionalWritableRoots,
]);
// We intentionally omit 'approvalPolicy' and 'confirmationPrompt' from the deps
// so switching modes or showing confirmation dialogs doesnt tear down the loop.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [model, provider, config, requestConfirmation, additionalWritableRoots]);
// 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