branch: externals/ellama
commit 7cbcaa69fc0759ee9ccb30bc98454e7d58a0cf59
Author: Sergey Kostyaev <[email protected]>
Commit: Sergey Kostyaev <[email protected]>

    Fix file write tool
    
    Corrected the order of operations in `ellama-tools-write-file-tool` by 
setting
    the buffer file name before inserting content.
---
 ellama-tools.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ellama-tools.el b/ellama-tools.el
index 5db40956e9..aca8fabf5f 100644
--- a/ellama-tools.el
+++ b/ellama-tools.el
@@ -315,8 +315,8 @@ TOOL-PLIST is a property list in the format expected by 
`llm-make-tool'."
 (defun ellama-tools-write-file-tool (path content)
   "Write CONTENT to the file located at the specified PATH."
   (with-temp-buffer
-    (insert content)
     (setq buffer-file-name (expand-file-name path))
+    (insert content)
     (save-buffer)))
 
 (ellama-tools-define-tool

Reply via email to