fix: deep-convert nested stdClass params in executeTool endpoint

When the AI Gateway sends nested JSON objects (like legalAnalysis), PHP
decodes them as stdClass. The previous (array) cast only converted the
top level, leaving nested stdClass that caused "Cannot use object as
array" fatal errors. Now uses json_decode(json_encode()) for recursive
array conversion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 20:59:12 +00:00
parent 1bb0c06345
commit 289a9cf27f
2 changed files with 2 additions and 2 deletions
@@ -186,7 +186,7 @@ class SmartAssistant
}
$tool = $data->tool;
$params = (array) ($data->params ?? []);
$params = json_decode(json_encode($data->params ?? []), true) ?? [];
$caseId = $data->caseId ?? null;
$executor = $this->injectableFactory->create(ActionExecutor::class);
+1 -1
View File
@@ -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.1",
"version": "2.7.2",
"acceptableVersions": [
">=8.0.0"
],