From 9f65dafe5556d81f7a3ccd7980d097a5e7dfde80 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Mon, 14 Jul 2025 08:23:14 -0700 Subject: [PATCH] fmt --- codex-rs/core/src/codex.rs | 13 +++++++++++-- codex-rs/exec/src/event_processor.rs | 1 - codex-rs/tui/src/chatwidget.rs | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index c3b20ef7e1..d39f239b88 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -1127,11 +1127,14 @@ async fn try_run_turn( // If we execute a function call in the middle of handling the stream, it can time out. let mut input = Vec::new(); while let Some(event) = stream.next().await { - input.push(event?); + let event = event?; + info!("Received stream event: {event:?}"); + input.push(event); } let mut output = Vec::new(); for event in input { + info!("Processing event: {event:?}"); match event { ResponseEvent::Created => { let mut state = sess.state.lock().unwrap(); @@ -1198,11 +1201,16 @@ async fn handle_response_item( } None } - ResponseItem::Reasoning { id: _, summary, content } => { + ResponseItem::Reasoning { + id: _, + summary, + content, + } => { for item in summary { let text = match item { ReasoningItemReasoningSummary::SummaryText { text } => text, }; + info!("Agent reasoning: {text}"); let event = Event { id: sub_id.to_string(), msg: EventMsg::AgentReasoning(AgentReasoningEvent { text }), @@ -1213,6 +1221,7 @@ async fn handle_response_item( let text = match item { ReasoningItemContent::ReasoningText { text } => text, }; + info!("Agent reasoning content: {text}"); let event = Event { id: sub_id.to_string(), msg: EventMsg::AgentReasoningContent(AgentReasoningContentEvent { text }), diff --git a/codex-rs/exec/src/event_processor.rs b/codex-rs/exec/src/event_processor.rs index 03100ce455..57a364c3f1 100644 --- a/codex-rs/exec/src/event_processor.rs +++ b/codex-rs/exec/src/event_processor.rs @@ -15,7 +15,6 @@ use codex_core::protocol::McpToolCallBeginEvent; use codex_core::protocol::McpToolCallEndEvent; use codex_core::protocol::PatchApplyBeginEvent; use codex_core::protocol::PatchApplyEndEvent; -use codex_core::protocol::AgentReasoningContentEvent; use codex_core::protocol::SessionConfiguredEvent; use codex_core::protocol::TokenUsage; use owo_colors::OwoColorize; diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index f1923be1a1..3841db1dd9 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -254,6 +254,7 @@ impl ChatWidget<'_> { } EventMsg::AgentReasoningContent(AgentReasoningContentEvent { text }) => { if !self.config.hide_agent_reasoning && self.config.show_reasoning_content { + let text = format!("Full Reasoning Content: {text}"); self.conversation_history .add_agent_reasoning(&self.config, text); self.request_redraw();