From f9e50eba7085d64eb5a55119c845bc46f2254627 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 25 Aug 2026 15:43:23 +0300 Subject: [PATCH] Remove canned creative fallback content --- modules/interaction/domain/chat.go | 11 ++++------- modules/interaction/domain/chat_test.go | 5 ++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/interaction/domain/chat.go b/modules/interaction/domain/chat.go index 5456aa4..f75289f 100644 --- a/modules/interaction/domain/chat.go +++ b/modules/interaction/domain/chat.go @@ -665,14 +665,11 @@ func CreativeDeterministicReply(message string) string { return "" } -// CreativeFallbackReply keeps a small creative conversation useful when the -// cognitive channel is unavailable. It is not used when cognition returns a -// completed richer answer. +// CreativeFallbackReply intentionally has no canned creative content. The +// cognitive route must construct the requested result while preserving all +// user attributes; a degraded path must not pretend that a prepared answer +// was generated. func CreativeFallbackReply(message string) string { - tokens := semanticTokens(message) - if IsCreativeRequest(message) && containsStemInTokens(tokens, "сказк", "басн") && containsStemInTokens(tokens, "колоб") { - return "Жили-были дед и баба. Испекли они Колобка, а он убежал в лес. Встретил зайца, волка и медведя — от всех укатился, но лису перехитрить не смог. Так Колобок понял: хвастовство и беспечность до добра не доводят." - } return "" } diff --git a/modules/interaction/domain/chat_test.go b/modules/interaction/domain/chat_test.go index 458c4f5..5275d70 100644 --- a/modules/interaction/domain/chat_test.go +++ b/modules/interaction/domain/chat_test.go @@ -1,7 +1,6 @@ package domain import ( - "strings" "testing" "time" @@ -283,8 +282,8 @@ func TestInterpretCreativeRequestDoesNotRequireExternalEvidence(t *testing.T) { if !IsCreativeRequest("расскажи сказку о колобке") { t.Fatal("story request was not recognized as creative") } - if got := CreativeFallbackReply("расскажи сказку о колобке"); !strings.Contains(got, "Колоб") { - t.Fatalf("story fallback = %q", got) + if got := CreativeFallbackReply("расскажи сказку о колобке"); got != "" { + t.Fatalf("creative request received canned content = %q", got) } for _, message := range []string{"нарисуй птицу", "нарисуй зеленую птицу", "нарисуй птицу в HD", "нарисуй коня"} { if got := CreativeDeterministicReply(message); got != "" {