gptel icon indicating copy to clipboard operation
gptel copied to clipboard

gptel-menu gives error

Open ankitf opened this issue 1 year ago • 20 comments

gtel version - v0.9.0

transient-setup: Wrong type argument: (or eieio-object cl-structure-object oclosure), ""

ankitf avatar Jul 26 '24 10:07 ankitf

How did you install gptel?

karthink avatar Jul 27 '24 03:07 karthink

I have the same issue. My gptel-menu is no longer working with -v0.9.0.

I use spacemacs and included gptel in dotspacemacs-additional-packages as stated in gptel readme. My understanding is that this installs gptel from MELPA? Thanks.

DouwMarx avatar Jul 29 '24 13:07 DouwMarx

Can you produce a backtrace? M-x toggle-debug-on-error and produce the error.

karthink avatar Jul 29 '24 17:07 karthink

Running emacs-gptel from guix packages @ commit 8c6e724686ac37ff7955b97d9bfd03176b14d82a in a guix shell.

  transient--exit-and-debug(error (wrong-type-argument (or eieio-object cl-structure-object oclosure) ""))
  eieio-oref("" key)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_171>("")
  transient--maybe-pad-keys(#<transient-column transient-column-b9df214> #<transient-columns transient-columns-b9df0dc>)
  #f(compiled-function (column) #<bytecode 0x97c7da258ac159a>)(#<transient-column transient-column-b9df214>)
  mapcar(#f(compiled-function (column) #<bytecode 0x97c7da258ac159a>) (#<transient-column transient-column-b9df10e> #<transient-column transient-column-b9df214>))
  #f(compiled-function (group) #<bytecode 0xe79175334a628c1>)(#<transient-columns transient-columns-b9df0dc>)
  apply(#f(compiled-function (group) #<bytecode 0xe79175334a628c1>) #<transient-columns transient-columns-b9df0dc>)
  #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>)(#<transient-columns transient-columns-b9df0dc>)
  #f(compiled-function (cl--cnm group) #<bytecode -0x4b40a9e5299e6df>)(#f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #<transient-columns transient-columns-b9df0dc>)
  apply(#f(compiled-function (cl--cnm group) #<bytecode -0x4b40a9e5299e6df>) #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #<transient-columns transient-columns-b9df0dc>)
  #f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1e07387d87fc2035>)(#<transient-columns transient-columns-b9df0dc>)
  apply(#f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1e07387d87fc2035>) #<transient-columns transient-columns-b9df0dc> nil)
  transient--insert-group(#<transient-columns transient-columns-b9df0dc>)
  transient--insert-groups()
  transient--show()
  transient--redisplay()
  transient-setup(gptel-menu)
  gptel-menu()
  funcall-interactively(gptel-menu)
  command-execute(gptel-menu record)
  execute-extended-command(nil "gptel-menu" nil)
  funcall-interactively(execute-extended-command nil "gptel-menu" nil)
  command-execute(execute-extended-command)```

0x715C avatar Jul 30 '24 03:07 0x715C

How did you install gptel?

I installed it using straight use package. Here is the installation excerpt from my config.

#+begin_src emacs-lisp
  (use-package gptel
	:straight t	
   ) 
#+end_src

ankitf avatar Jul 30 '24 08:07 ankitf

Can you produce a backtrace? M-x toggle-debug-on-error and produce the error.

Here is the trace.

Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) "")
  transient--exit-and-debug(error (wrong-type-argument (or eieio-object cl-structure-object oclosure) ""))
  eieio-oref("" key)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_167>("")
  transient--maybe-pad-keys(#<transient-column transient-column-160b6dda7888> #<transient-columns transient-columns-160b6dda7750>)
  #f(compiled-function (column) #<bytecode -0x13f2c378d47e6432>)(#<transient-column transient-column-160b6dda7888>)
  mapcar(#f(compiled-function (column) #<bytecode -0x13f2c378d47e6432>) (#<transient-column transient-column-160b6dda7782> #<transient-column transient-column-160b6dda7888>))
  #f(compiled-function (group) #<bytecode 0x1039c6fdfac53f00>)(#<transient-columns transient-columns-160b6dda7750>)
  apply(#f(compiled-function (group) #<bytecode 0x1039c6fdfac53f00>) #<transient-columns transient-columns-160b6dda7750>)
  #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>)(#<transient-columns transient-columns-160b6dda7750>)
  #f(compiled-function (cl--cnm group) #<bytecode -0x4831328a62834df>)(#f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #<transient-columns transient-columns-160b6dda7750>)
  apply(#f(compiled-function (cl--cnm group) #<bytecode -0x4831328a62834df>) #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #<transient-columns transient-columns-160b6dda7750>)
  #f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x7223506b0ca2037>)(#<transient-columns transient-columns-160b6dda7750>)
  apply(#f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x7223506b0ca2037>) #<transient-columns transient-columns-160b6dda7750> nil)
  transient--insert-group(#<transient-columns transient-columns-160b6dda7750>)
  transient--insert-groups()
  transient--show()
  transient--redisplay()
  transient-setup(gptel-menu)
  gptel-menu()
  funcall-interactively(gptel-menu)
  command-execute(gptel-menu record)
  execute-extended-command(nil "gptel-menu" nil)
  funcall-interactively(execute-extended-command nil "gptel-menu" nil)
  command-execute(execute-extended-command)

ankitf avatar Jul 30 '24 08:07 ankitf

What is the version of transient you're using? To find it you can run M-x find-library, transient, then look at the header:

;; Package-Version: 0.6.0

karthink avatar Jul 30 '24 19:07 karthink

;; Package-Version: 0.7.3

Running gptel-menu in emacs 29.4 with gptel v0.8.6 and emacs-transient v0.7.3 works fine. gptel v0.9.0 gives the error.

0x715C avatar Jul 31 '24 02:07 0x715C

Transient,

;; Package-Version: 0.4.1

I updated transient to 0.7.3. Gives the same error.

ankitf avatar Aug 01 '24 06:08 ankitf

I updated transient to version 0.7.3, which caused numerous errors in both Magit and Dirvish. Hence, I decided to do a fresh installation of all the straight packages (it's been 3 years since I updated the packages).

After the fresh installation, transient is at version 0.7.3. and gptel-menu works just fine now. All the errors of magit and dirvish are also resolved. Thanks for looking into it. @karthink

ankitf avatar Aug 01 '24 07:08 ankitf

This commit gptel-menu works fine. The next commit does not guix shell --pure --with-commit=emacs-gptel=5d093f2135dcf69c8493183902e5b932b0aa2c2b emacs emacs-gptel emacs-transient -- emacs

Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) "")
  transient--exit-and-debug(error (wrong-type-argument (or eieio-object cl-structure-object oclosure) ""))
  eieio-oref("" key)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_171>("")
  transient--maybe-pad-keys(#<transient-column transient-column-733385c> #<transient-columns transient-columns-73322aa>)
  #f(compiled-function (column) #<bytecode -0x125140492c585751>)(#<transient-column transient-column-733385c>)
  mapcar(#f(compiled-function (column) #<bytecode -0x125140492c585751>) (#<transient-column transient-column-73322e4> #<transient-column transient-column-733385c>))
  #f(compiled-function (group) #<bytecode 0x851e45735231781>)(#<transient-columns transient-columns-73322aa>)
  apply(#f(compiled-function (group) #<bytecode 0x851e45735231781>) #<transient-columns transient-columns-73322aa>)
  #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>)(#<transient-columns transient-columns-73322aa>)
  #f(compiled-function (cl--cnm group) #<bytecode -0x4b708eb4c583e9f>)(#f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #<transient-columns transient-columns-73322aa>)
  apply(#f(compiled-function (cl--cnm group) #<bytecode -0x4b708eb4c583e9f>) #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #<transient-columns transient-columns-73322aa>)
  #f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1e31532587fc2035>)(#<transient-columns transient-columns-73322aa>)
  apply(#f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1e31532587fc2035>) #<transient-columns transient-columns-73322aa> nil)
  transient--insert-group(#<transient-columns transient-columns-73322aa>)
  transient--insert-groups()
  transient--show()
  transient--redisplay()
  transient-setup(gptel-menu)
  gptel-menu()
  funcall-interactively(gptel-menu)
  command-execute(gptel-menu record)
  execute-extended-command(nil "gptel-menu" "gptel-menu")
  funcall-interactively(execute-extended-command nil "gptel-menu" "gptel-menu")
  command-execute(execute-extended-command)

0x715C avatar Aug 01 '24 08:08 0x715C

@0x715C Thanks for pinpointing the commit, I can see what's causing the error now. It's the use of :pad-keys with the empty line "" here. But I'm not sure why yet.

@ankitf You're using Transient 0.7.3 now (same as @0x715C) but don't experience this issue any more? That's puzzling.

karthink avatar Aug 02 '24 00:08 karthink

@0x715C Thanks for pinpointing the commit, I can see what's causing the error now. It's the use of :pad-keys with the empty line "" here. But I'm not sure why yet.

I can confirm that gptel-send does not produce an error, and seems to work, after removing ":pad-keys t" from gptel-transient.el. I'm not familiar with transient so I have no more ideas.

0x715C avatar Aug 02 '24 10:08 0x715C

@karthink Yes. using Transient 0.7.3 now. In my opinion source, of the error is some other package. I had the same setup in a new machine with fresh install and there was no error. But it threw the error in my daily machine where most of the packages were old.

ankitf avatar Aug 02 '24 10:08 ankitf

I cannot reproduce this error with the latest version of transient (0.7.4). Can someone experiencing the issue check this?

(Note: I couldn't reproduce this with transient 0.7.3 either.)

karthink avatar Aug 15 '24 18:08 karthink

Yea, I still get the error with guix time-machine -- shell --pure emacs emacs-gptel emacs-transient -- emacs.

0x715C avatar Aug 16 '24 04:08 0x715C

I get this error: emacs 29.4 gptel 0.9.0 transient 0.7.4


Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) "") transient--exit-and-debug(error (wrong-type-argument (or eieio-object cl-structure-object oclosure) "")) eieio-oref("" key) #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_169>("") transient--maybe-pad-keys(# #) #f(compiled-function (column) #<bytecode -0x410d23c16416aad>)(#) mapcar(#f(compiled-function (column) #<bytecode -0x410d23c16416aad>) (# #)) #f(compiled-function (group) #<bytecode -0xe794ce21a48a8c0>)(#) apply(#f(compiled-function (group) #<bytecode -0xe794ce21a48a8c0>) #) #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>)(#) #f(compiled-function (cl--cnm group) #<bytecode -0x483e13aa70df85f>)(#f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #) apply(#f(compiled-function (cl--cnm group) #<bytecode -0x483e13aa70df85f>) #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #) #f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x18caca95a8ca2031>)(#) apply(#f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x18caca95a8ca2031>) # nil) transient--insert-group(#) transient--insert-groups() transient--show() transient--redisplay() transient-setup(gptel-menu) gptel-menu() funcall-interactively(gptel-menu) command-execute(gptel-menu record) #(nil "gptel-menu" nil) ad-Advice-execute-extended-command(# nil "gptel-menu") apply(ad-Advice-execute-extended-command # (nil "gptel-menu")) execute-extended-command(nil "gptel-menu") smex-read-and-run(("toggle-debug-on-error" "gptel-menu" "package-list-packages" "gptel" "package-refresh-contents" "find-library" "gptel-send" "magit" "comment-region" "uncomment-region" "iedit-mode" "blacken-buffer" "find-grep" "org-agenda" "magit-pull" "flycheck-projectile-list-errors" "cd" "magit-blame" "python-isort-buffer" "indent-region" "eval-buffer" "magit-log" "comint-run" "pdb" "magit-checkout" "describe-variable" "sh-mode" "org-capture" "comint-send-input" "list-flycheck-errors" "dired-jump" "dired-mark" "whitespace-cleanup" "magit-file-checkout" "python-pytest-dispatch" "vterm" "version" "copy-file" "find-file" "load-theme" "sh-cd-here" "comment-box" "check-parens" "projectile-ag" "conda-env-list" "replace-string" "fortune-compile" "point-to-register" "conda-env-activate" "projectile-replace" ...)) smex() funcall-interactively(smex) command-execute(smex)

apcode avatar Aug 26 '24 11:08 apcode

I'm aware of #361, but as far as I can tell, this is a Transient bug so I don't want to work around it in a way where I'll forget about the hack and cause trouble in the future.

If you are experiencing the error, what would really help is a minimal reproducer that combines :pad-keys t and a blank line "", so I can discuss it with tarsius, the Transient maintainer.

Something like this, which I can't confirm since I can't reproduce the bug on Transient 0.7.3.

(transient-define-prefix test-menu ()
  "Change parameters of prompt to send to the LLM."
  [:description "Test menu"
   [:pad-keys t
    ""
    "Some text"
    ("2" "Split vertically" split-window-vertically)
    ("3" "Split horizontally" split-window-horizontally)]])

karthink avatar Sep 03 '24 21:09 karthink

The issue seems to have disappeared for me after updating my guix channel lock. I can reproduce it at guix commit 3e1330b2c74c7ec957c0de69f5253c6bcf045c2f, but somewhere between there and commit c1a0889c4e983dced02720c2ec33ac40af7fec1b it no longer occurs.

0x715C avatar Sep 17 '24 17:09 0x715C

@0x715C Thanks for the update. I'm not sure what to do about it now.

karthink avatar Sep 20 '24 04:09 karthink

@karthink I narrowed down the change in guix that allows gptel-menu to function correctly. https://git.savannah.gnu.org/cgit/guix.git/commit/?id=cc26f737d1e7705bb0f002745eb4eebd1ac96c1f Seems, at least in my case, this issue is with emacs native-comp and not an issue with gptel or transient.

0x715C avatar Oct 26 '24 04:10 0x715C

If anyone in this thread is still experiencing this error (with gptel-menu), please let me know. I will close this issue otherwise.

karthink avatar Oct 30 '24 02:10 karthink

Just hit this error on Emacs 29.4 + native compilation + latest DOOM on Ubuntu 22.04. Debug output below:

Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) "")
  transient--exit-and-debug(error (wrong-type-argument (or eieio-object cl-structure-object oclosure) ""))
  eieio-oref("" key)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_169>("")
  transient--maybe-pad-keys(#<transient-column transient-column-1728abbeb89c> #<transient-columns transient-columns-1728abf7bbc2>)
  #f(compiled-function (column) #<bytecode -0x167f82b215082d91>)(#<transient-column transient-column-1728abbeb89c>)
  mapcar(#f(compiled-function (column) #<bytecode -0x167f82b215082d91>) (#<transient-column transient-column-1728abf7bbe2> #<transient-column transient-column-1728abbeb89c>))
  #f(compiled-function (group) #<bytecode 0x582c7755c19b780>)(#<transient-columns transient-columns-1728abf7bbc2>)
  apply(#f(compiled-function (group) #<bytecode 0x582c7755c19b780>) #<transient-columns transient-columns-1728abf7bbc2>)
  #f(compiled-function (&rest args) #<bytecode 0xf004b0aa79eaf37>)(#<transient-columns transient-columns-1728abf7bbc2>)
  #f(compiled-function (cl--cnm group) #<bytecode -0x484739d4a81d81f>)(#f(compiled-function (&rest args) #<bytecode 0xf004b0aa79eaf37>) #<transient-columns transient-columns-1728abf7bbc2>)
  apply(#f(compiled-function (cl--cnm group) #<bytecode -0x484739d4a81d81f>) #f(compiled-function (&rest args) #<bytecode 0xf004b0aa79eaf37>) #<transient-columns transient-columns-1728abf7bbc2>)
  #f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1f2e612c33ae1c37>)(#<transient-columns transient-columns-1728abf7bbc2>)
  apply(#f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1f2e612c33ae1c37>) #<transient-columns transient-columns-1728abf7bbc2> nil)
  transient--insert-group(#<transient-columns transient-columns-1728abf7bbc2>)
  #<subr transient--insert-groups>()
  apply(#<subr transient--insert-groups> nil)
  transient--insert-groups()
  transient--show()
  transient--redisplay()
  transient-setup(gptel-menu)
  gptel-menu()
  funcall-interactively(gptel-menu)
  call-interactively(gptel-menu)
  (if (and arg (require 'gptel-transient nil t)) (call-interactively #'gptel-menu) (message "Querying %s..." (progn (or (progn (and (memq (type-of gptel-backend) cl-struct-gptel-backend-tags) t)) (signal 'wrong-type-argument (list 'gptel-backend gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status " Waiting..." 'warning))
  (closure (t) (&optional arg) "Submit this prompt to the current LLM backend.\n\nBy..." (interactive "P") (if (and arg (require 'gptel-transient nil t)) (call-interactively #'gptel-menu) (message "Querying %s..." (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status " Waiting..." 'warning)))((4))
  gptel-org--send-with-props((closure (t) (&optional arg) "Submit this prompt to the current LLM backend.\n\nBy..." (interactive "P") (if (and arg (require 'gptel-transient nil t)) (call-interactively #'gptel-menu) (message "Querying %s..." (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status " Waiting..." 'warning))) (4))
  apply(gptel-org--send-with-props (closure (t) (&optional arg) "Submit this prompt to the current LLM backend.\n\nBy..." (interactive "P") (if (and arg (require 'gptel-transient nil t)) (call-interactively #'gptel-menu) (message "Querying %s..." (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status " Waiting..." 'warning))) (4))
  gptel-send((4))
  funcall-interactively(gptel-send (4))
  command-execute(gptel-send)

lkirkwood avatar Nov 06 '24 04:11 lkirkwood

Just hit this error on Emacs 29.4 + native compilation + latest DOOM on Ubuntu 22.04. Debug output below:

Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) &quot;&quot;)
  transient--exit-and-debug(error (wrong-type-argument (or eieio-object cl-structure-object oclosure) &quot;&quot;))
  eieio-oref(&quot;&quot; key)
  #&lt;subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_169&gt;(&quot;&quot;)
  transient--maybe-pad-keys(#&lt;transient-column transient-column-1728abbeb89c&gt; #&lt;transient-columns transient-columns-1728abf7bbc2&gt;)
  #f(compiled-function (column) #&lt;bytecode -0x167f82b215082d91&gt;)(#&lt;transient-column transient-column-1728abbeb89c&gt;)
  mapcar(#f(compiled-function (column) #&lt;bytecode -0x167f82b215082d91&gt;) (#&lt;transient-column transient-column-1728abf7bbe2&gt; #&lt;transient-column transient-column-1728abbeb89c&gt;))
  #f(compiled-function (group) #&lt;bytecode 0x582c7755c19b780&gt;)(#&lt;transient-columns transient-columns-1728abf7bbc2&gt;)
  apply(#f(compiled-function (group) #&lt;bytecode 0x582c7755c19b780&gt;) #&lt;transient-columns transient-columns-1728abf7bbc2&gt;)
  #f(compiled-function (&amp;rest args) #&lt;bytecode 0xf004b0aa79eaf37&gt;)(#&lt;transient-columns transient-columns-1728abf7bbc2&gt;)
  #f(compiled-function (cl--cnm group) #&lt;bytecode -0x484739d4a81d81f&gt;)(#f(compiled-function (&amp;rest args) #&lt;bytecode 0xf004b0aa79eaf37&gt;) #&lt;transient-columns transient-columns-1728abf7bbc2&gt;)
  apply(#f(compiled-function (cl--cnm group) #&lt;bytecode -0x484739d4a81d81f&gt;) #f(compiled-function (&amp;rest args) #&lt;bytecode 0xf004b0aa79eaf37&gt;) #&lt;transient-columns transient-columns-1728abf7bbc2&gt;)
  #f(compiled-function (group) &quot;Insert GROUP&#39;s description, if any.&quot; #&lt;bytecode 0x1f2e612c33ae1c37&gt;)(#&lt;transient-columns transient-columns-1728abf7bbc2&gt;)
  apply(#f(compiled-function (group) &quot;Insert GROUP&#39;s description, if any.&quot; #&lt;bytecode 0x1f2e612c33ae1c37&gt;) #&lt;transient-columns transient-columns-1728abf7bbc2&gt; nil)
  transient--insert-group(#&lt;transient-columns transient-columns-1728abf7bbc2&gt;)
  #&lt;subr transient--insert-groups&gt;()
  apply(#&lt;subr transient--insert-groups&gt; nil)
  transient--insert-groups()
  transient--show()
  transient--redisplay()
  transient-setup(gptel-menu)
  gptel-menu()
  funcall-interactively(gptel-menu)
  call-interactively(gptel-menu)
  (if (and arg (require &#39;gptel-transient nil t)) (call-interactively #&#39;gptel-menu) (message &quot;Querying %s...&quot; (progn (or (progn (and (memq (type-of gptel-backend) cl-struct-gptel-backend-tags) t)) (signal &#39;wrong-type-argument (list &#39;gptel-backend gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status &quot; Waiting...&quot; &#39;warning))
  (closure (t) (&amp;optional arg) &quot;Submit this prompt to the current LLM backend.\n\nBy...&quot; (interactive &quot;P&quot;) (if (and arg (require &#39;gptel-transient nil t)) (call-interactively #&#39;gptel-menu) (message &quot;Querying %s...&quot; (progn (or (progn (and ... t)) (signal &#39;wrong-type-argument (list ... gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status &quot; Waiting...&quot; &#39;warning)))((4))
  gptel-org--send-with-props((closure (t) (&amp;optional arg) &quot;Submit this prompt to the current LLM backend.\n\nBy...&quot; (interactive &quot;P&quot;) (if (and arg (require &#39;gptel-transient nil t)) (call-interactively #&#39;gptel-menu) (message &quot;Querying %s...&quot; (progn (or (progn (and ... t)) (signal &#39;wrong-type-argument (list ... gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status &quot; Waiting...&quot; &#39;warning))) (4))
  apply(gptel-org--send-with-props (closure (t) (&amp;optional arg) &quot;Submit this prompt to the current LLM backend.\n\nBy...&quot; (interactive &quot;P&quot;) (if (and arg (require &#39;gptel-transient nil t)) (call-interactively #&#39;gptel-menu) (message &quot;Querying %s...&quot; (progn (or (progn (and ... t)) (signal &#39;wrong-type-argument (list ... gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status &quot; Waiting...&quot; &#39;warning))) (4))
  gptel-send((4))
  funcall-interactively(gptel-send (4))
  command-execute(gptel-send)
  1. Can you try rebuilding gptel? Not sure how you do this in Doom, but it involves re-byte-compiling gptel and its dependencies.
  2. What is your version of Transient? M-x find-library transient, then look at the header for the version.

karthink avatar Nov 06 '24 04:11 karthink

I also have the same error as in the OP, when I try C-u M-x gptel-send

transient-setup: Wrong type argument: (or eieio-object cl-structure-object oclosure), ""

My software versions: Emacs 29.4 (installed from debian bookworm-backports) Org mode version 9.6.15 Transient version: 0.3.7

Is it just because of my older version of transient package? (using the elpa-transient package from debian bookworm)

k4r4b3y avatar Nov 07 '24 12:11 k4r4b3y

I also have the same error as in the OP, when I try C-u M-x gptel-send

transient-setup: Wrong type argument: (or eieio-object cl-structure-object oclosure), &quot;&quot;

My software versions: Emacs 29.4 (installed from debian bookworm-backports) Org mode version 9.6.15 Transient version: 0.3.7

Is it just because of my older version of transient package? (using the elpa-transient package from debian bookworm)

gptel requires at least Transient 0.4.0, so I'm not sure how you installed gptel. Try updating Transient.

karthink avatar Nov 07 '24 16:11 karthink

Just hit this error on Emacs 29.4 + native compilation + latest DOOM on Ubuntu 22.04. Debug output below:

Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) "")
  transient--exit-and-debug(error (wrong-type-argument (or eieio-object cl-structure-object oclosure) ""))
  eieio-oref("" key)
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_169>("")
  transient--maybe-pad-keys(#<transient-column transient-column-1728abbeb89c> #<transient-columns transient-columns-1728abf7bbc2>)
  #f(compiled-function (column) #<bytecode -0x167f82b215082d91>)(#<transient-column transient-column-1728abbeb89c>)
  mapcar(#f(compiled-function (column) #<bytecode -0x167f82b215082d91>) (#<transient-column transient-column-1728abf7bbe2> #<transient-column transient-column-1728abbeb89c>))
  #f(compiled-function (group) #<bytecode 0x582c7755c19b780>)(#<transient-columns transient-columns-1728abf7bbc2>)
  apply(#f(compiled-function (group) #<bytecode 0x582c7755c19b780>) #<transient-columns transient-columns-1728abf7bbc2>)
  #f(compiled-function (&rest args) #<bytecode 0xf004b0aa79eaf37>)(#<transient-columns transient-columns-1728abf7bbc2>)
  #f(compiled-function (cl--cnm group) #<bytecode -0x484739d4a81d81f>)(#f(compiled-function (&rest args) #<bytecode 0xf004b0aa79eaf37>) #<transient-columns transient-columns-1728abf7bbc2>)
  apply(#f(compiled-function (cl--cnm group) #<bytecode -0x484739d4a81d81f>) #f(compiled-function (&rest args) #<bytecode 0xf004b0aa79eaf37>) #<transient-columns transient-columns-1728abf7bbc2>)
  #f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1f2e612c33ae1c37>)(#<transient-columns transient-columns-1728abf7bbc2>)
  apply(#f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1f2e612c33ae1c37>) #<transient-columns transient-columns-1728abf7bbc2> nil)
  transient--insert-group(#<transient-columns transient-columns-1728abf7bbc2>)
  #<subr transient--insert-groups>()
  apply(#<subr transient--insert-groups> nil)
  transient--insert-groups()
  transient--show()
  transient--redisplay()
  transient-setup(gptel-menu)
  gptel-menu()
  funcall-interactively(gptel-menu)
  call-interactively(gptel-menu)
  (if (and arg (require 'gptel-transient nil t)) (call-interactively #'gptel-menu) (message "Querying %s..." (progn (or (progn (and (memq (type-of gptel-backend) cl-struct-gptel-backend-tags) t)) (signal 'wrong-type-argument (list 'gptel-backend gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status " Waiting..." 'warning))
  (closure (t) (&optional arg) "Submit this prompt to the current LLM backend.\n\nBy..." (interactive "P") (if (and arg (require 'gptel-transient nil t)) (call-interactively #'gptel-menu) (message "Querying %s..." (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status " Waiting..." 'warning)))((4))
  gptel-org--send-with-props((closure (t) (&optional arg) "Submit this prompt to the current LLM backend.\n\nBy..." (interactive "P") (if (and arg (require 'gptel-transient nil t)) (call-interactively #'gptel-menu) (message "Querying %s..." (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status " Waiting..." 'warning))) (4))
  apply(gptel-org--send-with-props (closure (t) (&optional arg) "Submit this prompt to the current LLM backend.\n\nBy..." (interactive "P") (if (and arg (require 'gptel-transient nil t)) (call-interactively #'gptel-menu) (message "Querying %s..." (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... gptel-backend))) (aref gptel-backend 1))) (gptel--sanitize-model) (gptel-request nil :stream gptel-stream) (gptel--update-status " Waiting..." 'warning))) (4))
  gptel-send((4))
  funcall-interactively(gptel-send (4))
  command-execute(gptel-send)

@karthink @lkirkwood I was facing the same issue with Doom emacs. After running doom upgrade and restarting the daemon, everything seems to be working fine. Thank you for your efforts.

prajwaljpj avatar Nov 14 '24 03:11 prajwaljpj

Closing this issue now -- if anyone looking for a solution reads this, try updating the Transient package. If that doesn't work, please open a new issue.

karthink avatar Nov 14 '24 04:11 karthink

Apologies for the delayed response.

  1. Can you try rebuilding gptel? Not sure how you do this in Doom, but it involves re-byte-compiling gptel and its dependencies.

I deleted the package from .config/emacs/.local/straight/repos/gptel/ and ran doom sync to reinstall it, but it didn't help.

  1. What is your version of Transient? M-x find-library transient, then look at the header for the version.

;; Package-Version: 0.5.3

I was facing the same issue with Doom emacs. After running doom upgrade and restarting the daemon, everything seems to be working fine. Thank you for your efforts.

This fixed it! Transient is now version 0.7.9 which I guess is why. Thank you @karthink and @prajwaljpj.

lkirkwood avatar Nov 14 '24 07:11 lkirkwood