branch: elpa/gptel
commit e1c01f86e602be606915ce18440fb775f8384e77
Author: Psionic K <73710933+psioni...@users.noreply.github.com>
Commit: GitHub <nore...@github.com>

    gptel: Pass nil result through to model (#596)
    
    gptel.el (gptel--handle-tool-use): When the tool call succeeds (as in does 
not error) but returns nil, we still
    need to show the model that the tool returned a nil result.
    
    Otherwise the model seems to not progress in its reply.
---
 gptel.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gptel.el b/gptel.el
index eda7794c78..dd726fcde6 100644
--- a/gptel.el
+++ b/gptel.el
@@ -1931,10 +1931,9 @@ Run post-response hooks."
                   (arg-values)
                   (process-tool-result
                    (lambda (result)
-                     (when result
-                       (plist-put info :tool-success t)
-                       (plist-put tool-call :result (gptel--to-string result))
-                       (push (list name arg-values result) result-alist))
+                     (plist-put info :tool-success t)
+                     (plist-put tool-call :result (gptel--to-string result))
+                     (push (list name arg-values result) result-alist)
                      (cl-incf tool-idx)
                      (when (>= tool-idx ntools) ; All tools have run
                        (gptel--inject-prompt

Reply via email to