Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

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

Mitchell Kutchuk09f0ae389991
diff --git a/codex-cli/src/components/chat/terminal-chat.tsx b/codex-cli/src/components/chat/terminal-chat.tsx
index 8558208005..4859513a4f 100644
--- a/codex-cli/src/components/chat/terminal-chat.tsx
+++ b/codex-cli/src/components/chat/terminal-chat.tsx
@@ -305,15 +305,10 @@ export default function TerminalChat({
agentRef.current = undefined;
forceUpdate(); // re‑render 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 doesn’t 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