Shutdown exec/run threads after completion

This commit is contained in:
Charles Cunningham
2026-01-26 09:07:39 -08:00
parent 61e5efc502
commit 305190df68
@@ -1535,6 +1535,11 @@ impl CodexMessageProcessor {
}
.await;
if let Some(thread_for_shutdown) = self.thread_manager.remove_thread(&thread_id).await {
// `exec/run` threads are one-shot; shut them down to avoid leaking resources.
let _ = thread_for_shutdown.submit(Op::Shutdown).await;
}
let thread_ids_to_skip_listener_attachment_for_cleanup =
thread_ids_to_skip_listener_attachment.clone();
tokio::spawn(async move {