karthink / gptel

A simple LLM client for Emacs
GNU General Public License v3.0
1.04k stars 113 forks source link

gptel-menu throws error "transient-setup: Suffix gptel--infix-provider is not defined or autoloaded as a command" #132

Closed nhoffman closed 8 months ago

nhoffman commented 8 months ago

Hi, I just updated gptel using straight to commit 66d2bafad6a6f51d4e4e015db7e66c5eae319a17 and I'm getting the above error. I'm running emacs 28.2 on macos 14.1. Other functions seem to work - or at least I'm able to use the completions feature in a gptel buffer.

Thanks a lot for any suggestions.

Here's the complete traceback:

Debugger entered--Lisp error: (error "Suffix gptel--infix-provider is not defined or aut...")
  apply(debug (error (error "Suffix gptel--infix-provider is not defined or aut...")))
  transient--exit-and-debug(error (error "Suffix gptel--infix-provider is not defined or aut..."))
  signal(error ("Suffix gptel--infix-provider is not defined or aut..."))
  error("Suffix %s is not defined or autoloaded as a comman..." gptel--infix-provider)
  transient--ensure-infix-command(#<gptel-provider-variable gptel-provider-variable-4aaad22e>)
  transient--init-suffix(nil (1 transient-suffix (:command gptel--infix-provider)))
  transient--init-child(nil (1 transient-suffix (:command gptel--infix-provider)))
  #f(compiled-function (c) #<bytecode -0x142fd94982e5334e>)((1 transient-suffix (:command gptel--infix-provider)))
  mapcan(#f(compiled-function (c) #<bytecode -0x142fd94982e5334e>) ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature))))
  cl-mapcan(#f(compiled-function (c) #<bytecode -0x142fd94982e5334e>) ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature))))
  transient--init-group(nil [1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))])
  transient--init-child(nil [1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))])
  #f(compiled-function (c) #<bytecode -0x142fd94982e5334e>)([1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))])
  mapcan(#f(compiled-function (c) #<bytecode -0x142fd94982e5334e>) ([1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))] [1 transient-column (:description "Prompt:") ((1 transient-switch (:key "p" :description "From minibuffer instead" :argument "p" :command transient:gptel-menu:p)) (1 transient-switch (:key "i" :description "Replace/Delete prompt" :argument "i" :command transient:gptel-menu:i)) "Response to:" (1 transient-switch (:key "m" :description "Minibuffer instead" :argument "m" :command transient:gptel-menu:m)) (1 transient-option (:key "n" :description "New session" :argument "n" :command transient:gptel-menu:n :prompt "Name for new session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0x119c4a7d802c54e5>))) (1 transient-option (:key "e" :description "Existing session" :argument "e" :command transient:gptel-menu:e :prompt "Existing session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0xa92e22614bffad8>))) (1 transient-switch (:key "k" :description "Kill-ring" :argument "k" :command transient:gptel-menu:k)))] [1 transient-column (:description gptel--refactor-or-rewrite :if use-region-p) ((1 transient-suffix (:key "r" :description #f(compiled-function () #<bytecode -0x121ce0e5e839a4d5>) :command gptel-rewrite-menu)))] [1 transient-column (:description "Send") ((1 transient-suffix (:command gptel--suffix-send)))]))
  cl-mapcan(#f(compiled-function (c) #<bytecode -0x142fd94982e5334e>) ([1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))] [1 transient-column (:description "Prompt:") ((1 transient-switch (:key "p" :description "From minibuffer instead" :argument "p" :command transient:gptel-menu:p)) (1 transient-switch (:key "i" :description "Replace/Delete prompt" :argument "i" :command transient:gptel-menu:i)) "Response to:" (1 transient-switch (:key "m" :description "Minibuffer instead" :argument "m" :command transient:gptel-menu:m)) (1 transient-option (:key "n" :description "New session" :argument "n" :command transient:gptel-menu:n :prompt "Name for new session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0x119c4a7d802c54e5>))) (1 transient-option (:key "e" :description "Existing session" :argument "e" :command transient:gptel-menu:e :prompt "Existing session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0xa92e22614bffad8>))) (1 transient-switch (:key "k" :description "Kill-ring" :argument "k" :command transient:gptel-menu:k)))] [1 transient-column (:description gptel--refactor-or-rewrite :if use-region-p) ((1 transient-suffix (:key "r" :description #f(compiled-function () #<bytecode -0x121ce0e5e839a4d5>) :command gptel-rewrite-menu)))] [1 transient-column (:description "Send") ((1 transient-suffix (:command gptel--suffix-send)))]))
  transient--init-group(nil [1 transient-columns nil ([1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))] [1 transient-column (:description "Prompt:") ((1 transient-switch (:key "p" :description "From minibuffer instead" :argument "p" :command transient:gptel-menu:p)) (1 transient-switch (:key "i" :description "Replace/Delete prompt" :argument "i" :command transient:gptel-menu:i)) "Response to:" (1 transient-switch (:key "m" :description "Minibuffer instead" :argument "m" :command transient:gptel-menu:m)) (1 transient-option (:key "n" :description "New session" :argument "n" :command transient:gptel-menu:n :prompt "Name for new session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0x119c4a7d802c54e5>))) (1 transient-option (:key "e" :description "Existing session" :argument "e" :command transient:gptel-menu:e :prompt "Existing session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0xa92e22614bffad8>))) (1 transient-switch (:key "k" :description "Kill-ring" :argument "k" :command transient:gptel-menu:k)))] [1 transient-column (:description gptel--refactor-or-rewrite :if use-region-p) ((1 transient-suffix (:key "r" :description #f(compiled-function () #<bytecode -0x121ce0e5e839a4d5>) :command gptel-rewrite-menu)))] [1 transient-column (:description "Send") ((1 transient-suffix (:command gptel--suffix-send)))])])
  transient--init-child(nil [1 transient-columns nil ([1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))] [1 transient-column (:description "Prompt:") ((1 transient-switch (:key "p" :description "From minibuffer instead" :argument "p" :command transient:gptel-menu:p)) (1 transient-switch (:key "i" :description "Replace/Delete prompt" :argument "i" :command transient:gptel-menu:i)) "Response to:" (1 transient-switch (:key "m" :description "Minibuffer instead" :argument "m" :command transient:gptel-menu:m)) (1 transient-option (:key "n" :description "New session" :argument "n" :command transient:gptel-menu:n :prompt "Name for new session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0x119c4a7d802c54e5>))) (1 transient-option (:key "e" :description "Existing session" :argument "e" :command transient:gptel-menu:e :prompt "Existing session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0xa92e22614bffad8>))) (1 transient-switch (:key "k" :description "Kill-ring" :argument "k" :command transient:gptel-menu:k)))] [1 transient-column (:description gptel--refactor-or-rewrite :if use-region-p) ((1 transient-suffix (:key "r" :description #f(compiled-function () #<bytecode -0x121ce0e5e839a4d5>) :command gptel-rewrite-menu)))] [1 transient-column (:description "Send") ((1 transient-suffix (:command gptel--suffix-send)))])])
  #f(compiled-function (c) #<bytecode -0x142fd94982e5334e>)([1 transient-columns nil ([1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))] [1 transient-column (:description "Prompt:") ((1 transient-switch (:key "p" :description "From minibuffer instead" :argument "p" :command transient:gptel-menu:p)) (1 transient-switch (:key "i" :description "Replace/Delete prompt" :argument "i" :command transient:gptel-menu:i)) "Response to:" (1 transient-switch (:key "m" :description "Minibuffer instead" :argument "m" :command transient:gptel-menu:m)) (1 transient-option (:key "n" :description "New session" :argument "n" :command transient:gptel-menu:n :prompt "Name for new session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0x119c4a7d802c54e5>))) (1 transient-option (:key "e" :description "Existing session" :argument "e" :command transient:gptel-menu:e :prompt "Existing session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0xa92e22614bffad8>))) (1 transient-switch (:key "k" :description "Kill-ring" :argument "k" :command transient:gptel-menu:k)))] [1 transient-column (:description gptel--refactor-or-rewrite :if use-region-p) ((1 transient-suffix (:key "r" :description #f(compiled-function () #<bytecode -0x121ce0e5e839a4d5>) :command gptel-rewrite-menu)))] [1 transient-column (:description "Send") ((1 transient-suffix (:command gptel--suffix-send)))])])
  mapcan(#f(compiled-function (c) #<bytecode -0x142fd94982e5334e>) ([1 transient-column (:description #f(compiled-function () #<bytecode 0x16dbf822b4033f20>)) ((1 transient-suffix (:key "h" :description "Set directives for chat" :command gptel-system-prompt :transient t)))] [1 transient-columns nil ([1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))] [1 transient-column (:description "Prompt:") ((1 transient-switch (:key "p" :description "From minibuffer instead" :argument "p" :command transient:gptel-menu:p)) (1 transient-switch (:key "i" :description "Replace/Delete prompt" :argument "i" :command transient:gptel-menu:i)) "Response to:" (1 transient-switch (:key "m" :description "Minibuffer instead" :argument "m" :command transient:gptel-menu:m)) (1 transient-option (:key "n" :description "New session" :argument "n" :command transient:gptel-menu:n :prompt "Name for new session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0x119c4a7d802c54e5>))) (1 transient-option (:key "e" :description "Existing session" :argument "e" :command transient:gptel-menu:e :prompt "Existing session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0xa92e22614bffad8>))) (1 transient-switch (:key "k" :description "Kill-ring" :argument "k" :command transient:gptel-menu:k)))] [1 transient-column (:description gptel--refactor-or-rewrite :if use-region-p) ((1 transient-suffix (:key "r" :description #f(compiled-function () #<bytecode -0x121ce0e5e839a4d5>) :command gptel-rewrite-menu)))] [1 transient-column (:description "Send") ((1 transient-suffix (:command gptel--suffix-send)))])] [1 transient-columns (:hide #f(compiled-function () #<bytecode 0x173df4febf7923a2>)) ([1 transient-column (:description "Value commands") ((1 transient-suffix (:key "C-x s  " :description "Set" :command transient-set)) (1 transient-suffix (:key "C-x C-s" :description "Save" :command transient-save)) (1 transient-suffix (:key "C-x C-k" :description "Reset" :command transient-reset)) (1 transient-suffix (:key "C-x p  " :description "Previous value" :command transient-history-prev)) (1 transient-suffix (:key "C-x n  " :description "Next value" :command transient-history-next)))] [1 transient-column (:description "Sticky commands") ((1 transient-suffix (:key "C-g" :description "Quit prefix or transient" :command transient-quit-one)) (1 transient-suffix (:key "C-q" :description "Quit transient stack" :command transient-quit-all)) (1 transient-suffix (:key "C-z" :description "Suspend transient stack" :command transient-suspend)))] [1 transient-column (:description "Customize") ((1 transient-suffix (:key "C-x t" :command transient-toggle-common :description #f(compiled-function () #<bytecode 0x1e0d3e1d07fd89b5>))) (1 transient-suffix (:key "C-x l" :description "Show/hide suffixes" :command transient-set-level)))])]))
  cl-mapcan(#f(compiled-function (c) #<bytecode -0x142fd94982e5334e>) ([1 transient-column (:description #f(compiled-function () #<bytecode 0x16dbf822b4033f20>)) ((1 transient-suffix (:key "h" :description "Set directives for chat" :command gptel-system-prompt :transient t)))] [1 transient-columns nil ([1 transient-column (:description "Session Parameters") ((1 transient-suffix (:command gptel--infix-provider)) (1 transient-suffix (:command gptel--infix-max-tokens)) (1 transient-suffix (:command gptel--infix-num-messages-to-send)) (1 transient-suffix (:command gptel--infix-temperature)))] [1 transient-column (:description "Prompt:") ((1 transient-switch (:key "p" :description "From minibuffer instead" :argument "p" :command transient:gptel-menu:p)) (1 transient-switch (:key "i" :description "Replace/Delete prompt" :argument "i" :command transient:gptel-menu:i)) "Response to:" (1 transient-switch (:key "m" :description "Minibuffer instead" :argument "m" :command transient:gptel-menu:m)) (1 transient-option (:key "n" :description "New session" :argument "n" :command transient:gptel-menu:n :prompt "Name for new session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0x119c4a7d802c54e5>))) (1 transient-option (:key "e" :description "Existing session" :argument "e" :command transient:gptel-menu:e :prompt "Existing session: " :reader #f(compiled-function (prompt _ history) #<bytecode 0xa92e22614bffad8>))) (1 transient-switch (:key "k" :description "Kill-ring" :argument "k" :command transient:gptel-menu:k)))] [1 transient-column (:description gptel--refactor-or-rewrite :if use-region-p) ((1 transient-suffix (:key "r" :description #f(compiled-function () #<bytecode -0x121ce0e5e839a4d5>) :command gptel-rewrite-menu)))] [1 transient-column (:description "Send") ((1 transient-suffix (:command gptel--suffix-send)))])] [1 transient-columns (:hide #f(compiled-function () #<bytecode 0x173df4febf7923a2>)) ([1 transient-column (:description "Value commands") ((1 transient-suffix (:key "C-x s  " :description "Set" :command transient-set)) (1 transient-suffix (:key "C-x C-s" :description "Save" :command transient-save)) (1 transient-suffix (:key "C-x C-k" :description "Reset" :command transient-reset)) (1 transient-suffix (:key "C-x p  " :description "Previous value" :command transient-history-prev)) (1 transient-suffix (:key "C-x n  " :description "Next value" :command transient-history-next)))] [1 transient-column (:description "Sticky commands") ((1 transient-suffix (:key "C-g" :description "Quit prefix or transient" :command transient-quit-one)) (1 transient-suffix (:key "C-q" :description "Quit transient stack" :command transient-quit-all)) (1 transient-suffix (:key "C-z" :description "Suspend transient stack" :command transient-suspend)))] [1 transient-column (:description "Customize") ((1 transient-suffix (:key "C-x t" :command transient-toggle-common :description #f(compiled-function () #<bytecode 0x1e0d3e1d07fd89b5>))) (1 transient-suffix (:key "C-x l" :description "Show/hide suffixes" :command transient-set-level)))])]))
  transient--init-suffixes(gptel-menu)
  transient--init-objects(gptel-menu nil nil)
  transient-setup(gptel-menu)
  gptel-menu()
  #<subr funcall-interactively>(gptel-menu)
  apply(#<subr funcall-interactively> gptel-menu)
  funcall-interactively(gptel-menu)
  #<subr call-interactively>(gptel-menu record nil)
  apply(#<subr call-interactively> (gptel-menu record nil))
  explain-pause--wrap-call-interactively(#<subr call-interactively> gptel-menu record nil)
  apply(explain-pause--wrap-call-interactively #<subr call-interactively> (gptel-menu record nil))
  call-interactively(gptel-menu record nil)
  command-execute(gptel-menu record)
  execute-extended-command(nil "gptel-menu" "gptel-")
  #<subr funcall-interactively>(execute-extended-command nil "gptel-menu" "gptel-")
  apply(#<subr funcall-interactively> (execute-extended-command nil "gptel-menu" "gptel-"))
  funcall-interactively(execute-extended-command nil "gptel-menu" "gptel-")
  #<subr call-interactively>(execute-extended-command nil nil)
  apply(#<subr call-interactively> (execute-extended-command nil nil))
  explain-pause--wrap-call-interactively(#<subr call-interactively> execute-extended-command nil nil)
  apply(explain-pause--wrap-call-interactively #<subr call-interactively> (execute-extended-command nil nil))
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)
karthink commented 8 months ago

I suspect an issue with native compilation, see #120.

  1. Try rebuilding the package with straight-rebuild-package
  2. Delete the eln-cache for this package, or run emacs-lisp-native-compile-and-load on the files in this package.
nhoffman commented 8 months ago

Thanks! Neither straight-rebuild-package nor rm eln-cache/*/gptel-* worked (I didn't try the third suggestion), but rm -rf elpa straight eln-cache followed by a restart and reinstall of all of my packages did fix the problem. Thanks a lot for the quick response and for this package!

karthink commented 8 months ago

but rm -rf elpa straight eln-cache followed by a restart and reinstall

Wow that's a pretty drastic move. Sorry you had to go through that much trouble.

EDIT: manually native compiling the gptel-*.el files would probably have replaced the ones in the eln cache and fixed the problem. I'm still not sure what causes it.

nhoffman commented 8 months ago

Really not a big deal - I try hard to maintain my config to make it easy to do a clean reinstall for setting up a new machine or nuking it all and starting again in situations like this! This sort of error does seem like a hazard of native compilation in general, so thanks for the advice - I'll give that a shot if there are issues with this or other packages in the future.