diff --git a/cmd/core-runtime/main.go b/cmd/core-runtime/main.go index 005da3b..3cefdb6 100644 --- a/cmd/core-runtime/main.go +++ b/cmd/core-runtime/main.go @@ -581,7 +581,11 @@ func main() { conversationHistory = append(conversationHistory, recentUserHistory...) gen2Context := interactiondomain.BuildScopedGen2Context(conversationHistory, string(session.PrincipalID)) retrievedMemoryReply := interactiondomain.RecallPersonalPreference(conversationHistory, effectiveTaskMessage) - if !creativeUserRequest && locationReply == "" { + stableConversationalReply, stableConversational := interactiondomain.StableConversationalReply( + effectiveTaskMessage, + interactiondomain.ClassifySpeechAct(effectiveTaskMessage, utterance.CorrectsUtteranceID), + ) + if !creativeUserRequest && locationReply == "" && !stableConversational { if continuation := interactiondomain.ContinueLocalSearch(effectiveTaskMessage, conversationHistory); continuation != "" { continuationMessage = continuation effectiveTaskMessage = continuation @@ -731,7 +735,7 @@ func main() { cognitiveAvailable = false } } - if !creativeRequest { + if !creativeRequest && !stableConversational { if travelReply := interactiondomain.TravelSearchClarification(effectiveTaskMessage, conversationHistory); travelReply != "" { semantic.Interpretation.Clarification = interaction.ClarificationRequired semantic.Interpretation.Applicability = interaction.SemanticCandidateClarify @@ -780,7 +784,7 @@ func main() { } else if len(semantic.Projects) > 0 && semantic.Projects[0].Provenance == situation.ProjectResolutionInheritedFocus { projectID = string(previousFocus.ProjectID) } - if responseErr == nil && responseResult.Handled { + if responseErr == nil && responseResult.Handled && !stableConversational { planningReply = responseResult.Reply needsCognition = false learning.recordReminderResponse(r.Context(), reminderResponseLearningInput{Utterance: utterance, Intent: intent, Result: responseResult, At: now}) @@ -917,7 +921,7 @@ func main() { planningReply = helpPath.Reply needsCognition = false } - if !creativeRequest { + if !creativeRequest && !stableConversational { if travelReply := interactiondomain.TravelSearchClarification(effectiveTaskMessage, conversationHistory); travelReply != "" { planningReply = travelReply needsCognition = false @@ -1077,13 +1081,8 @@ func main() { } } if !mediaAttempted && !mediaHandled && identityReply == "" && creativeReply == "" && creativeFallbackReply == "" { - stableAct := interactiondomain.ClassifySpeechAct(utterance.Content, utterance.CorrectsUtteranceID) - travelClarification := "" - if !creativeRequest { - travelClarification = interactiondomain.TravelSearchClarification(effectiveTaskMessage, conversationHistory) - } - if stableReply, stable := interactiondomain.StableConversationalReply(utterance.Content, stableAct); stable && travelClarification == "" { - planningReply = stableReply + if stableConversational { + planningReply = stableConversationalReply needsCognition = false } }