branch: externals/ellama
commit 7630ae60e89a480980e4d98316d7962c129c54f9
Author: Sergey Kostyaev <[email protected]>
Commit: Sergey Kostyaev <[email protected]>
Simplify tool result handling and report tool configuration
Added nil check before JSON encoding to prevent processing empty results.
Removed confirmation wrapper from report tool to fix agentic execution.
---
ellama-tools.el | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/ellama-tools.el b/ellama-tools.el
index 1939125c17..1b52fa81d7 100644
--- a/ellama-tools.el
+++ b/ellama-tools.el
@@ -156,9 +156,9 @@ FUNCTION if approved, \"Forbidden by the user\" otherwise."
;; No - return nil
((eq answer ?n)
"Forbidden by the user"))))
- (if (stringp result)
- result
- (json-encode result)))))))
+ (when result (if (stringp result)
+ result
+ (json-encode result))))))))
(defun ellama-tools-wrap-with-confirm (tool-plist)
"Wrap a tool's function with automatic confirmation.
@@ -774,8 +774,7 @@ ROLE – role key from `ellama-tools-subagent-roles'."
;; ---- dynamic report_result tool ----
(report-tool
(apply #'llm-make-tool
- (ellama-tools-wrap-with-confirm
- (ellama-tools--make-report-result-tool callback worker))))
+ (ellama-tools--make-report-result-tool callback worker)))
;; IMPORTANT: report tool must be first (termination tool priority)
(all-tools (cons report-tool role-tools)))