From 079fd2adb96bf1b66f3d339e6ee0c0b71f35c322 Mon Sep 17 00:00:00 2001 From: Kbediako <70529246+Kbediako@users.noreply.github.com> Date: Thu, 22 Jan 2026 17:09:58 +1100 Subject: [PATCH] Fix: Lower log level for closed-channel send (#9653) ## What? - Downgrade the closed-channel send error log to debug in `codex-rs/core/src/codex.rs`. ## Why? - `async_channel::Sender::send` only fails when the channel is closed, so the current error-level log is noisy during normal shutdown. See issue #9652. ## How? - Replace the error log with a debug log on send failure. ## Tests - `just fmt` - `just fix -p codex-core` - `cargo test -p codex-core` --- codex-rs/core/src/codex.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index f0ff887b01..cb81c9aa4d 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -1181,7 +1181,7 @@ impl Session { let rollout_items = vec![RolloutItem::EventMsg(event.msg.clone())]; self.persist_rollout_items(&rollout_items).await; if let Err(e) = self.tx_event.send(event).await { - error!("failed to send tool call event: {e}"); + debug!("dropping event because channel is closed: {e}"); } } @@ -1199,7 +1199,7 @@ impl Session { .await; self.flush_rollout().await; if let Err(e) = self.tx_event.send(event).await { - error!("failed to send tool call event: {e}"); + debug!("dropping event because channel is closed: {e}"); } }