branch: externals/ellama
commit 190d616f4bccd146c43598163d5bae47196ad71c
Merge: 366f05f7ab bcb0ffe417
Author: Sergey Kostyaev <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #376 from s-kostyaev/fix-for-non-project-directories
    
    Simplify project root detection
---
 NEWS.org  | 5 +++++
 ellama.el | 7 +++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index b4bf00f841..ce9e05be17 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,8 @@
+* Version 1.12.1
+- Simplify project root detection in ~ellama-get-agents-md-path~ to use
+  ~ellama-tools-project-root-tool~. This refactoring eliminates potential nil
+  returns from project-current, making the function more robust when locating
+  the AGENTS.md file.
 * Version 1.12.0
 - Add asynchronous task delegation functionality via the new ~task~ tool that
   allows delegating descriptions to subagents with custom roles and max-steps
diff --git a/ellama.el b/ellama.el
index a350cfc85a..c49b410daa 100644
--- a/ellama.el
+++ b/ellama.el
@@ -6,7 +6,7 @@
 ;; URL: http://github.com/s-kostyaev/ellama
 ;; Keywords: help local tools
 ;; Package-Requires: ((emacs "28.1") (llm "0.24.0") (plz "0.8") (transient 
"0.7") (compat "29.1") (yaml "1.2.3"))
-;; Version: 1.12.0
+;; Version: 1.12.1
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;; Created: 8th Oct 2023
 
@@ -1217,9 +1217,8 @@ Otherwire return current active session."
   "Search for AGENTS.md file from current directory up to project root.
 Returns the full path to AGENTS.md if found, or nil if not found."
   (let* ((current-dir (file-name-directory (expand-file-name 
default-directory)))
-         (project-root
-         (file-name-directory (expand-file-name
-                               (or (project-root (project-current)) 
current-dir))))
+         (project-root (file-name-directory (expand-file-name
+                                            (ellama-tools-project-root-tool))))
          found-path)
     ;; Walk up from current directory to project root
     (while (and (not found-path)

Reply via email to