feat: keep domovoy alive in lifeboat mode
CI / test (push) Failing after 15s

This commit is contained in:
m
2026-08-21 14:52:55 +03:00
parent 0a2599cfa6
commit 009314e930
9 changed files with 142 additions and 6 deletions
+8 -1
View File
@@ -37,11 +37,18 @@ func TestCognitiveChannelQuestionUsesHumanSafeHealthReply(t *testing.T) {
func TestCognitiveConfigurationRequestDoesNotPretendToMutate(t *testing.T) {
reply := humanCognitiveChannelReply("Переключи локальную модель", capability.Health{State: capability.HealthUnavailable}, nil)
if !strings.Contains(reply, "не меняю модель") || !strings.Contains(reply, "консоли") {
if !strings.Contains(reply, "Домовой жив") || !strings.Contains(reply, "аварийн") {
t.Fatalf("unexpected configuration reply: %q", reply)
}
}
func TestCognitiveDegradedReplyKeepsDomovoyAlive(t *testing.T) {
reply := humanCognitiveDegradedReply("Помоги настроить локальную модель")
if !strings.Contains(reply, "Домовой жив") || !strings.Contains(reply, "принято") {
t.Fatalf("unexpected degraded reply: %q", reply)
}
}
func TestCreatorSessionHandlerAcceptsConfiguredCredentials(t *testing.T) {
handler := creatorSessionHandler("recovery", "m", "password", []byte("01234567890123456789012345678901"), func() time.Time { return time.Unix(1000, 0) })
request := httptest.NewRequest(http.MethodPost, "/v1/creator/sessions", strings.NewReader(`{"username":"m","password":"password"}`))