branch: externals/ellama
commit d19cb532165722f4e2bd83bc78130fababf0af57
Author: Sergey Kostyaev <sskosty...@gmail.com>
Commit: Sergey Kostyaev <sskosty...@gmail.com>

    Fix ellama-instant for working with reasoning models
    
    Display ellama instant result buffer on done instead of visible reasoning 
buffer.
---
 ellama.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ellama.el b/ellama.el
index 9b0b5d3424..b8b198fe05 100644
--- a/ellama.el
+++ b/ellama.el
@@ -1949,7 +1949,17 @@ ARGS contains keys for fine control.
                                        (make-temp-name (concat buffer-name " 
"))
                                      buffer-name)))
         (system (plist-get args :system))
-        (donecb (plist-get args :on-done))
+        (donecb (lambda (text)
+                  (let ((callback (plist-get args :on-done)))
+                    (display-buffer buffer
+                                    (when 
ellama-instant-display-action-function
+                                      `((ignore . 
(,ellama-instant-display-action-function)))))
+                    (when callback
+                      (if (and (listp callback)
+                               (functionp (car callback)))
+                          (mapc (lambda (fn) (funcall fn text))
+                                callback)
+                        (funcall callback text))))))
         filter)
     (with-current-buffer buffer
       (funcall ellama-major-mode)

Reply via email to