diff --git a/files/custom/Espo/Modules/SmartAssistant/Services/SmartAssistantService.php b/files/custom/Espo/Modules/SmartAssistant/Services/SmartAssistantService.php index dc3bee9..5e96fbf 100644 --- a/files/custom/Espo/Modules/SmartAssistant/Services/SmartAssistantService.php +++ b/files/custom/Espo/Modules/SmartAssistant/Services/SmartAssistantService.php @@ -122,10 +122,18 @@ class SmartAssistantService } // Execute tools with agentic loop — read tools feed results back to AI - $loopResult = $this->executeActionsWithLoop( - $message, $context, $conversationId, $conversationHistory, - $mode, $effectiveCaseId, $userId - ); + try { + $loopResult = $this->executeActionsWithLoop( + $message, $context, $conversationId, $conversationHistory, + $mode, $effectiveCaseId, $userId + ); + } catch (\Exception $e) { + $this->log->error("SmartAssistant: Chat failed: " . $e->getMessage()); + $loopResult = [ + 'responseText' => "⚠️ אירעה שגיאה בתקשורת עם המערכת. אנא נסה שוב בעוד מספר דקות.\n\nפרטי השגיאה: " . $e->getMessage(), + 'executedActions' => [], + ]; + } $responseText = $loopResult['responseText']; $executedActions = $loopResult['executedActions']; diff --git a/manifest.json b/manifest.json index 38b9f0e..014b734 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "module": "SmartAssistant", "description": "Unified AI Assistant for Legal CRM — floating chat with case memory, office alerts, and AI Gateway integration", "author": "klear", - "version": "2.7.0", + "version": "2.7.1", "acceptableVersions": [ ">=8.0.0" ],