From 1f743766a8be46b7c2b93c535ad2719b9ac8e06a Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Tue, 14 Apr 2026 17:57:48 -0300 Subject: [PATCH] fix: key-order agnostic signal detection in backend --- src/core/bot/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/bot/mod.rs b/src/core/bot/mod.rs index 14580388..8db873c5 100644 --- a/src/core/bot/mod.rs +++ b/src/core/bot/mod.rs @@ -882,9 +882,9 @@ impl BotOrchestrator { // Tool calls arrive as JSON that can span multiple chunks // Check if this chunk is an internal event (thinking/thinking_clear) - let is_internal_signal = if chunk.trim().starts_with("{\"type\"") { + let is_internal_signal = if chunk.trim().starts_with('{') { if let Ok(v) = serde_json::from_str::(&chunk) { - let t = v.get("type").and_then(|t: &serde_json::Value| t.as_str()).unwrap_or_default(); + let t = v.get("type").and_then(|t| t.as_str()).unwrap_or_default(); t == "thinking" || t == "thinking_clear" } else { false } } else { false };