branch: elpa/gptel
commit 48a5c13259a4843b5470c1182bc4966731eb1147
Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>

    gptel: Ignore debug when handling tool calls
    
    * gptel.el (gptel--accept-tool-calls, gptel--handle-tool-use): Use
    `condition-case' instead of `condition-case-unless-debug' when
    running tools.  Some users work with debug-on-error enabled and we
    want them to be able to work with tools that error without losing
    the request state.
---
 gptel.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gptel.el b/gptel.el
index ae2267348e..6bcbb98ddd 100644
--- a/gptel.el
+++ b/gptel.el
@@ -1969,7 +1969,7 @@ Run post-response hooks."
                    (apply (gptel-tool-function tool-spec)
                           process-tool-result arg-values)
                  (let ((result
-                        (condition-case-unless-debug errdata
+                        (condition-case errdata
                             (apply (gptel-tool-function tool-spec) arg-values)
                           (error (mapconcat #'gptel--to-string errdata " ")))))
                    (funcall process-tool-result result)))))))
@@ -2844,7 +2844,7 @@ NAME and ARG-VALUES are the name and arguments for the 
call."
                (apply (gptel-tool-function tool-spec)
                       process-tool-result arg-values)
              (let ((result
-                    (condition-case-unless-debug errdata
+                    (condition-case errdata
                         (apply (gptel-tool-function tool-spec) arg-values)
                       (error (mapconcat #'gptel--to-string errdata " ")))))
                (funcall process-tool-result result))))

Reply via email to