Handle memory identity and travel follow-ups
CI / test (push) Successful in 1m18s
CI / test (pull_request) Successful in 1m35s

This commit is contained in:
m
2026-08-25 10:20:54 +03:00
parent 3fa1d70379
commit 6b97d6668b
6 changed files with 78 additions and 9 deletions
+22
View File
@@ -707,6 +707,9 @@ func main() {
helpPath = work.HelpPath{}
}
switch semantic.InformationRequestKind {
case interaction.InformationRequestMemoryInventory:
planningReply = humanMemoryInventory(conversationHistory, assistantName)
needsCognition = false
case interaction.InformationRequestCapabilityInventory:
kinds, err := capabilityRepository.AvailableCapabilityKinds(r.Context(), session.PrincipalID)
if err == nil && len(kinds) > 0 {
@@ -1656,6 +1659,25 @@ func reviewPreservesResearchEvidence(reviewed, draft string) bool {
return true
}
func humanMemoryInventory(history []interaction.HumanUtterance, assistantName string) string {
rows := make([]string, 0, 4)
if assistantName != "" {
rows = append(rows, "| Имя помощника | "+assistantName+" |")
}
for index := len(history) - 1; index >= 0; index-- {
message := strings.TrimSpace(history[index].Content)
lower := strings.ToLower(message)
if strings.Contains(lower, "нравится") || strings.Contains(lower, "люблю") {
rows = append(rows, "| Предпочтение пользователя | "+message+" |")
break
}
}
if len(rows) == 0 {
return "| Ячейка памяти | Значение |\n|---|---|\n| — | Сохранённых пользовательских предпочтений пока не найдено. |"
}
return "| Ячейка памяти | Значение |\n|---|---|\n" + strings.Join(rows, "\n")
}
func researchSourceLabel(finding epistemics.ResearchFinding) string {
title := strings.TrimSpace(finding.Source.Title)
locator := strings.TrimSpace(finding.Source.Locator)