diff --git a/src-tauri/src/pipeline.rs b/src-tauri/src/pipeline.rs index 83f9cd7..4d77ad2 100644 --- a/src-tauri/src/pipeline.rs +++ b/src-tauri/src/pipeline.rs @@ -447,7 +447,7 @@ pub fn spawn_text_delivery_worker( .unwrap_or(global_s1_mini_enabled); let targets = voxctrl_routing::load_targets(&dir).unwrap_or_default(); - let (target_id, text) = if let Some(parsed) = voxctrl_routing::targets::parse_voice_command(&output.text, &targets) { + let (target_id, raw_text) = if let Some(parsed) = voxctrl_routing::targets::parse_voice_command(&output.text, &targets) { let matched_id = parsed.matched_target_id.clone(); let payload = parsed.payload; let matched_label = targets @@ -456,21 +456,22 @@ pub fn spawn_text_delivery_worker( .map(|t| if t.label.is_empty() { t.id.clone() } else { t.label.clone() }) .unwrap_or_else(|| matched_id.clone()); voxctrl_routing::targets::notify_command_trigger(&matched_label, &payload); - - let cleaned_payload = if s1_mini_enabled && !payload.trim().is_empty() { - voxctrl_inference::s1_mini::clean_dictation(&payload, &s1_mini_styling, None) - } else { - payload - }; - (matched_id, cleaned_payload) + (matched_id, payload) } else { withdraw_early_command(); - let cleaned_text = if s1_mini_enabled && !output.text.trim().is_empty() { - voxctrl_inference::s1_mini::clean_dictation(&output.text, &s1_mini_styling, None) - } else { - output.text.clone() - }; - (output.target_id.clone(), cleaned_text) + (output.target_id.clone(), output.text.clone()) + }; + + // Text bound for a Speak target is read aloud verbatim: S1-mini + // would add latency before the first word and may rewrite what + // the user meant to have spoken. + let is_speak_target = targets + .iter() + .any(|t| t.id == target_id && t.delivery == voxctrl_routing::DeliveryType::Speak); + let text = if !is_speak_target && s1_mini_enabled && !raw_text.trim().is_empty() { + voxctrl_inference::s1_mini::clean_dictation(&raw_text, &s1_mini_styling, None) + } else { + raw_text }; if text.trim().is_empty() {