From fe0adf17b7401112cc7b82663e0c389c0379465f Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Wed, 8 Apr 2026 21:00:56 +1000 Subject: [PATCH] fix: return raw text when chatparseError (#8402) --- .../src/providers/local_inference/inference_native_tools.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/goose/src/providers/local_inference/inference_native_tools.rs b/crates/goose/src/providers/local_inference/inference_native_tools.rs index 1894c4b6..f26847f4 100644 --- a/crates/goose/src/providers/local_inference/inference_native_tools.rs +++ b/crates/goose/src/providers/local_inference/inference_native_tools.rs @@ -157,6 +157,11 @@ pub(super) fn generate_with_native_tools( } Err(e) => { tracing::warn!("Streaming parser error: {}", e); + let mut msg = Message::assistant().with_text(piece); + msg.id = Some(message_id.to_string()); + if tx.blocking_send(Ok((Some(msg), None))).is_err() { + return Ok(TokenAction::Stop); + } } }