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

    Clear session context on reset command
    
    Added functionality to clear the current session's context when
    resetting the context. This prevents unexpected behavior by ensuring
    that the next chat call would be with clear context.
---
 NEWS.org  | 3 +++
 ellama.el | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/NEWS.org b/NEWS.org
index 359fbeb715..3a2a696fa7 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,6 @@
+* Version 1.1.2
+- Clear session context on calling reset context commant to prevent
+  suprising behaviour.
 * Version 1.1.1
 - Improve ~ellama-add-selection~.
 - Add buffer quote context element.
diff --git a/ellama.el b/ellama.el
index 762c758c77..ae7c8ff0c8 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.22.0") (spinner "1.7.4") 
(transient "0.7") (compat "29.1") (posframe "1.4.0"))
-;; Version: 1.1.1
+;; Version: 1.1.2
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;; Created: 8th Oct 2023
 
@@ -1042,6 +1042,9 @@ If EPHEMERAL non nil new session will not be associated 
with any file."
   (setq ellama--global-context nil)
   (with-current-buffer ellama--context-buffer
     (erase-buffer))
+  (when ellama--current-session-id
+    (with-current-buffer (ellama-get-session-buffer ellama--current-session-id)
+      (setf (ellama-session-context ellama--current-session) nil)))
   (posframe-hide ellama--context-buffer))
 
 ;; Context elements

Reply via email to