fix: tui freeze when sub-agents are present (#14816)

The issue was due to a circular `Drop` schema where the embedded
app-server wait for some listeners that wait for this app-server
them-selves.

The fix is an explicit cleaning

**Repro:**
* Start codex
* Ask it to spawn a sub-agent
* Close Codex
* It takes 5s to exit
This commit is contained in:
jif-oai
2026-03-16 16:42:43 +00:00
committed by GitHub
parent 3f266bcd68
commit c04a0a7454
4 changed files with 35 additions and 1 deletions

View File

@@ -456,6 +456,12 @@ impl MessageProcessor {
self.codex_message_processor.drain_background_tasks().await;
}
pub(crate) async fn clear_all_thread_listeners(&self) {
self.codex_message_processor
.clear_all_thread_listeners()
.await;
}
pub(crate) async fn shutdown_threads(&self) {
self.codex_message_processor.shutdown_threads().await;
}