Custom sentence triggers should be marked as processed locally (#145704)

* Mark custom sentence triggers a local agent

* Don't change agent ID

* adds tests to confirm processed_locally is True

* move asserts to after null check
This commit is contained in:
HarvsG 2025-06-24 20:25:40 +01:00 committed by GitHub
parent 265de91fba
commit ad4fae7f59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -1119,6 +1119,7 @@ class PipelineRun:
) is not None:
# Sentence trigger matched
agent_id = "sentence_trigger"
processed_locally = True
intent_response = intent.IntentResponse(
self.pipeline.conversation_language
)

View File

@ -1110,6 +1110,7 @@ async def test_sentence_trigger_overrides_conversation_agent(
None,
)
assert (intent_end_event is not None) and intent_end_event.data
assert intent_end_event.data["processed_locally"] is True
assert (
intent_end_event.data["intent_output"]["response"]["speech"]["plain"][
"speech"
@ -1192,6 +1193,7 @@ async def test_prefer_local_intents(
None,
)
assert (intent_end_event is not None) and intent_end_event.data
assert intent_end_event.data["processed_locally"] is True
assert (
intent_end_event.data["intent_output"]["response"]["speech"]["plain"][
"speech"