From 2c310cb5cb9e9cb7af7a60bb78700eb02daa737d Mon Sep 17 00:00:00 2001 From: Alex Yuan Date: Wed, 28 May 2025 23:32:15 -0400 Subject: [PATCH] fix: remove extraneous reasoning --- codex-rs/core/src/client.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/codex-rs/core/src/client.rs b/codex-rs/core/src/client.rs index 034cfaec45..629b96b50a 100644 --- a/codex-rs/core/src/client.rs +++ b/codex-rs/core/src/client.rs @@ -98,6 +98,13 @@ impl ModelClient { let full_instructions = prompt.get_full_instructions(); let tools_json = create_tools_json_for_responses_api(prompt, &self.model)?; + let mut reasoning: Option = None; + if self.model.starts_with("o") || self.model.starts_with("codex") { + reasoning = Some(Reasoning { + effort: "high", + summary: Some(Summary::Auto), + }); + } let payload = Payload { model: &self.model, instructions: &full_instructions, @@ -105,10 +112,7 @@ impl ModelClient { tools: &tools_json, tool_choice: "auto", parallel_tool_calls: false, - reasoning: Some(Reasoning { - effort: "high", - summary: Some(Summary::Auto), - }), + reasoning, previous_response_id: prompt.prev_id.clone(), store: prompt.store, stream: true,