fix: return raw text when chatparseError (#8402)

This commit is contained in:
Lifei Zhou
2026-04-08 21:00:56 +10:00
committed by GitHub
parent 0450aaa39f
commit fe0adf17b7
@@ -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);
}
}
}