lanceberge / elysium

Automatically apply AI-generated code changes in Emacs
GNU General Public License v3.0
126 stars 2 forks source link

Code changes do not get applied to the code buffer #3

Open LemonBreezes opened 4 days ago

LemonBreezes commented 4 days ago

Hello. I am trying to use elysiu-query from emacs -Q but the code changes do not get applied to the code buffer: image In the above screenshot, I used elysium-query from *scratch* and the code change it talked about in the chat did not show up at all in *scratch*.

The code I am using to reproduce this issue from emacs -Q is as follows:

;;; vanilla-emacs-configs/elysium-not-inserting-code.el -*- lexical-binding: t; -*-

;; Bootstrap straight
(defvar bootstrap-version)

(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
                                    'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package '(elysium :recipe (:host github :repo "lanceberge/elysium")))
(require 'elysium)

(defvar cae-anthropic-default-model "claude-3-5-sonnet-20240620")

;; Get the API key.
(ignore-errors
  (load-file "~/.config/doom/secrets/secrets.el"))

(setq
 gptel-model cae-anthropic-default-model
 gptel-backend (gptel-make-anthropic "Claude"
                 :stream t :key (cae-secrets-get-anthropic-api-key)))

;; For preventing error
(setq gptel-use-curl nil)

(global-set-key (kbd "<f5>") #'elysium-query)
(global-set-key (kbd "<f2>") #'gptel-menu)
(global-set-key (kbd "<f6>") #'gptel-send)
LemonBreezes commented 4 days ago

I am running Emacs 31.0.50, commit d277123f4bf855f0d055d283a42166f123fa1fde from the master branch.

gveres commented 10 hours ago

I had the same issue, my PR fixes it for me.