e40f3d4534
Without Controllers/AssistantRule.php, EspoCRM responds 404 "Controller 'AssistantRule' does not exist" on every POST/GET /api/v1/AssistantRule, even though scopes/AssistantRule.json declares entity=true, object=true, acl=true. The save_rule tool in shira-hermes calls the Record endpoint directly, gets the 404, falls back to nothing (because the user_id branch of the fallback rarely matches), and the LLM tells the user "✅ כלל נשמר" without verification — yet another instance of the hallucination pattern. A one-line Controller class that extends Espo\Core\Controllers\Record exposes the standard CRUD verbs and unlocks the storage path that the rest of the stack already expected. Verified in prod: GET, POST, DELETE all return 200 after this is in place. Paired with shira-hermes 06b27e9 which teaches the LLM to actually read the tool result and never report success on a ❌ response. Refs Task Master #6 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
17 lines
542 B
PHP
17 lines
542 B
PHP
<?php
|
|
|
|
namespace Espo\Modules\SmartAssistant\Controllers;
|
|
|
|
/**
|
|
* Exposes the AssistantRule entity over the standard REST API
|
|
* (GET/POST/PUT/DELETE /api/v1/AssistantRule).
|
|
*
|
|
* Without this controller class EspoCRM responds 404 "Controller does not exist"
|
|
* even when the entity, object, and acl flags in scopes/AssistantRule.json are
|
|
* set. Inheriting from Record gives us the full CRUD surface — list/search,
|
|
* read, create, update, delete — with ACL enforcement.
|
|
*/
|
|
class AssistantRule extends \Espo\Core\Controllers\Record
|
|
{
|
|
}
|