Fix conversation agent fallback (#139421)

pull/139859/head
Paulus Schoutsen 2025-02-27 14:51:40 +00:00 committed by Bram Kragten
parent 7732e6878e
commit 59d92c75bd
1 changed files with 10 additions and 6 deletions

View File

@ -1103,12 +1103,16 @@ class PipelineRun:
) & conversation.ConversationEntityFeature.CONTROL:
intent_filter = _async_local_fallback_intent_filter
# Try local intents first, if preferred.
elif self.pipeline.prefer_local_intents and (
intent_response := await conversation.async_handle_intents(
self.hass,
user_input,
intent_filter=intent_filter,
# Try local intents
if (
intent_response is None
and self.pipeline.prefer_local_intents
and (
intent_response := await conversation.async_handle_intents(
self.hass,
user_input,
intent_filter=intent_filter,
)
)
):
# Local intent matched