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

    gptel: Fix async prompt transform + gptel-send issues
    
    * gptel.el (gptel--realize-query): Fix call to
    `gptel-augment-post-modify-hook', which does not and has never
    existed.  (How did it get there?)
    
    (gptel-send): When there is an async prompt transform,
    gptel-send's message runs before the `:backend' field has been set
    in INFO.  Fix by falling back to the value of `gptel-backend' in
    `gptel-send'. This might be wrong, depending on what the prompt
    transform does, but at least it doesn't abort the process.
---
 gptel.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gptel.el b/gptel.el
index 0a0db05740..7c4f8c4cd6 100644
--- a/gptel.el
+++ b/gptel.el
@@ -2665,8 +2665,7 @@ Initiate the request when done."
         (when (and gptel-use-tools gptel-tools)
           (plist-put info :tools gptel-tools))
         (plist-put info :data
-                   (gptel--request-data gptel-backend full-prompt))
-        (run-hooks 'gptel-augment-post-modify-hook))
+                   (gptel--request-data gptel-backend full-prompt)))
       (kill-buffer (current-buffer)))
     ;; INIT -> WAIT
     (unless (plist-get info :dry-run) (gptel--fsm-transition fsm))
@@ -2729,6 +2728,7 @@ waiting for the response."
       (message "Querying %s..."
                (thread-first (gptel-fsm-info fsm)
                              (plist-get :backend)
+                             (or gptel-backend)
                              (gptel-backend-name))))
     (gptel--update-status " Waiting..." 'warning)))
 

Reply via email to