From b7b607ad69f1b036d7966b5e3c548a883f8698e3 Mon Sep 17 00:00:00 2001 From: Kevin Ahrendt Date: Mon, 10 Aug 2026 07:50:04 -0400 Subject: [PATCH] [voice_assistant] Note the background task exception in the threading comment model_load_task is declared below the comment and runs off the main loop, so the blanket main-loop-only claim was wrong for it. --- esphome/components/voice_assistant/voice_assistant.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/voice_assistant/voice_assistant.h b/esphome/components/voice_assistant/voice_assistant.h index 6ba1859cc2..e8c51e5747 100644 --- a/esphome/components/voice_assistant/voice_assistant.h +++ b/esphome/components/voice_assistant/voice_assistant.h @@ -381,8 +381,9 @@ class VoiceAssistant final : public Component { // Used from the background download task, not just the main loop, so that a download never blocks the loop. http_request::HttpRequestComponent *http_request_{nullptr}; - /* Runtime model management. Every member and method below is touched only on the main loop; the - background download task communicates results back via defer() with everything captured by value. */ + /* Runtime model management. Everything below is touched only on the main loop, except model_load_task (the + background task body), which reads http_request_ off the loop and hands results back via defer() with + everything captured by value. */ // External wake words advertised by Home Assistant, rebuilt from each configuration request so stale // entries drop out. Ownership of a loaded model itself lives in the WakeWordModel (micro_wake_word owns it).