harden Gen2 household introspection and readiness
CI / test (push) Failing after 33s

This commit is contained in:
m
2026-08-29 23:28:10 +03:00
parent 8ac4525569
commit 5387010a15
8 changed files with 97 additions and 12 deletions
+9 -5
View File
@@ -86,9 +86,12 @@ func InterpretUtterance(utterance interaction.HumanUtterance, projects []situati
result.Relations = append(result.Relations, relations...)
}
result.Reply = semanticReply(utterance.Content, result, previousFocus)
if isCurrentFocusQuestion(utterance.Content, selectedCandidate.PrimarySpeechAct) && previousFocus != nil {
if isCurrentFocusQuestion(utterance.Content, selectedCandidate.PrimarySpeechAct) {
result.NeedsCognition = false
result.Interpretation.NeedsCognition = false
result.CapabilityHints = nil
selectedCandidate.CapabilityHints = nil
result.Candidates[0] = selectedCandidate
}
return result, nil
}
@@ -343,8 +346,10 @@ func semanticReply(message string, result SemanticResult, previousFocus *situati
case interaction.SpeechActRejection:
return "Понял."
case interaction.SpeechActQuestion:
lower := strings.ToLower(message)
if previousFocus != nil && (strings.Contains(lower, "сейчас") || strings.Contains(lower, "что мы") || strings.Contains(lower, "делаем")) {
if focusIntrospectionQuestion(semanticTokens(message)) {
if previousFocus == nil {
return "Сейчас активный Focus не выбран."
}
return "Сейчас в фокусе: " + previousFocus.ProjectDisplayName + "."
}
if result.Interpretation.Applicability == interaction.SemanticNeedsBroaderInterpret || result.Interpretation.Applicability == interaction.SemanticLowConfidence {
@@ -385,8 +390,7 @@ func isCurrentFocusQuestion(message string, act interaction.SpeechAct) bool {
if act != interaction.SpeechActQuestion {
return false
}
lower := strings.ToLower(message)
return strings.Contains(lower, "сейчас") || strings.Contains(lower, "что мы") || strings.Contains(lower, "делаем")
return focusIntrospectionQuestion(semanticTokens(message))
}
func hasCorrectionMeaning(candidate interaction.SemanticCandidate, utterance interaction.HumanUtterance) bool {