From ce160b183d8d6d29cf6cbef48054f60843d6c4ef Mon Sep 17 00:00:00 2001 From: Will Pfleger Date: Mon, 23 Mar 2026 17:35:46 -0400 Subject: [PATCH] fix: handle reasoning content blocks in OpenAI-compat streaming parser (#8078) --- crates/goose/src/providers/formats/openai.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/goose/src/providers/formats/openai.rs b/crates/goose/src/providers/formats/openai.rs index db733fc4df..c696cb8e34 100644 --- a/crates/goose/src/providers/formats/openai.rs +++ b/crates/goose/src/providers/formats/openai.rs @@ -58,7 +58,8 @@ enum DeltaContent { #[derive(Serialize, Deserialize, Debug)] struct ContentPart { r#type: String, - text: String, + #[serde(default)] + text: Option, #[serde(rename = "thoughtSignature")] thought_signature: Option, } @@ -100,7 +101,7 @@ fn extract_content_and_signature( let text = text_parts .iter() - .map(|p| p.text.as_str()) + .filter_map(|p| p.text.as_deref()) .collect::(); let signature = text_parts