Fix conversation agent fallback (#139421)

This commit is contained in:
Paulus Schoutsen 2025-02-27 14:51:40 +00:00 committed by GitHub
parent f677b910a6
commit 744a7a0e82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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