Merge DEV-000062 focus question cognition fix
CI / test (push) Successful in 14s

Acceptance fix for DEV-000062 current-focus chat question.
This commit was merged in pull request #34.
This commit is contained in:
m
2026-08-17 11:48:44 +00:00
2 changed files with 14 additions and 0 deletions
+11
View File
@@ -71,6 +71,9 @@ func InterpretUtterance(utterance interaction.HumanUtterance, projects []situati
result.Relations = append(result.Relations, relations...)
}
result.Reply = semanticReply(utterance.Content, result, previousFocus)
if isCurrentFocusQuestion(utterance.Content, act) && previousFocus != nil {
result.NeedsCognition = false
}
return result, nil
}
@@ -229,3 +232,11 @@ func semanticReply(message string, result SemanticResult, previousFocus *situati
}
return FallbackText(result.Interpretation.SpeechAct)
}
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, "делаем")
}
@@ -61,6 +61,9 @@ func TestInterpretUtteranceQuestionAboutCurrentWorkUsesFocus(t *testing.T) {
if !strings.Contains(result.Reply, "Assistant") {
t.Fatalf("expected focus-aware reply, got %q", result.Reply)
}
if result.NeedsCognition {
t.Fatalf("focus question should be answered from canonical focus without cognition")
}
}
func TestInterpretUtteranceInheritedFocusForThere(t *testing.T) {