Skip to content

Commit 079fd2a

Browse files
authored
Fix: Lower log level for closed-channel send (openai#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 openai#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`
1 parent 038b78c commit 079fd2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codex-rs/core/src/codex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ impl Session {
11811181
let rollout_items = vec![RolloutItem::EventMsg(event.msg.clone())];
11821182
self.persist_rollout_items(&rollout_items).await;
11831183
if let Err(e) = self.tx_event.send(event).await {
1184-
error!("failed to send tool call event: {e}");
1184+
debug!("dropping event because channel is closed: {e}");
11851185
}
11861186
}
11871187

@@ -1199,7 +1199,7 @@ impl Session {
11991199
.await;
12001200
self.flush_rollout().await;
12011201
if let Err(e) = self.tx_event.send(event).await {
1202-
error!("failed to send tool call event: {e}");
1202+
debug!("dropping event because channel is closed: {e}");
12031203
}
12041204
}
12051205

0 commit comments

Comments
 (0)