Merge pull request 'Keep research replies concise' (#318) from codex/chat-semantic-inventory into main
CI / test (push) Successful in 1m10s

This commit was merged in pull request #318.
This commit is contained in:
m
2026-08-25 02:36:16 +00:00
+7 -3
View File
@@ -1577,13 +1577,17 @@ func renderResearchReply(result epistemics.ResearchResult, researchErr error) (s
return "Сейчас не удалось получить данные из подключённого источника. Попробую снова через доступный маршрут.", false
}
lines := make([]string, 0, 2)
for _, finding := range result.Findings {
for index, finding := range result.Findings {
if finding.State != epistemics.FindingSupported || strings.TrimSpace(finding.Excerpt.Text) == "" || strings.TrimSpace(finding.Source.Locator) == "" {
continue
}
excerpt := strings.TrimSpace(finding.Excerpt.Text)
if len([]rune(excerpt)) > 180 {
excerpt = string([]rune(excerpt)[:180]) + "…"
limit := 180
if index > 0 {
limit = 100
}
if len([]rune(excerpt)) > limit {
excerpt = string([]rune(excerpt)[:limit]) + "…"
}
lines = append(lines, excerpt+"\nИсточник: "+finding.Source.Locator)
if len(lines) == 2 {