Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug/Support]:gptel-menu not compatible? #362

Closed
2 of 3 tasks
SeanHaz opened this issue Sep 24, 2024 · 3 comments
Closed
2 of 3 tasks

[Bug/Support]:gptel-menu not compatible? #362

SeanHaz opened this issue Sep 24, 2024 · 3 comments

Comments

@SeanHaz
Copy link

SeanHaz commented Sep 24, 2024

Confirmation

  • I have checked the documentation (README, Wiki, docstrings, etc)
  • I am checking these without reading them.
  • I have searched previous issues to see if my question is a duplicate.

Elpaca Version

Elpaca de3060e grafted, HEAD -> master, origin/master, origin/HEAD
installer: 0.7
emacs-version: GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0)
of 2024-06-29, modified by Debian
git --version: git version 2.45.2

Operating System

Linux, Debian, Sid

Description

It probably seems strange that my request is about another package, but I think it must be an elpaca compatibility issue after testing it with elpa.

reproduce issue:

(elpaca-test
  :interactive t
  :init
  (elpaca (gptel
	   :repo "karthink/gptel"
	   :fetcher github)
    (setq gptel-api-key (auth-source-pick-first-password :host "api.openai.com" :user "sk-proj"))))

Then once installed, M-x gptel-menu results in the following:

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-156c6f9e08d0> #<transient-columns transient-columns-156c6f256670>)
  #f(compiled-function (column) #<bytecode -0x1e0e9a977047a26d>)(#<transient-column transient-column-156c6f9e08d0>)
  mapcar(#f(compiled-function (column) #<bytecode -0x1e0e9a977047a26d>) (#<transient-column transient-column-156c6f9c7c82> #<transient-column transient-column-156c6f9e08d0>))
  #f(compiled-function (group) #<bytecode 0x13c3d151ff5f0181>)(#<transient-columns transient-columns-156c6f256670>)
  apply(#f(compiled-function (group) #<bytecode 0x13c3d151ff5f0181>) #<transient-columns transient-columns-156c6f256670>)
  #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>)(#<transient-columns transient-columns-156c6f256670>)
  #f(compiled-function (cl--cnm group) #<bytecode -0x4ba828d2eca4b1f>)(#f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #<transient-columns transient-columns-156c6f256670>)
  apply(#f(compiled-function (cl--cnm group) #<bytecode -0x4ba828d2eca4b1f>) #f(compiled-function (&rest args) #<bytecode 0xf004b0aa7981c77>) #<transient-columns transient-columns-156c6f256670>)
  #f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1291e90aa9b42034>)(#<transient-columns transient-columns-156c6f256670>)
  apply(#f(compiled-function (group) "Insert GROUP's description, if any." #<bytecode 0x1291e90aa9b42034>) #<transient-columns transient-columns-156c6f256670> nil)
  transient--insert-group(#<transient-columns transient-columns-156c6f256670>)
  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-me")
  funcall-interactively(execute-extended-command nil "gptel-menu" "gptel-me")
  command-execute(execute-extended-command)

Also tried with this (in case it was broken on git)

(elpaca-test
  :interactive t
  :init
  (elpaca elpaca-use-package
    (elpaca-use-package-mode)
    (use-package gptel
      :ensure (gptel :source "GNU ELPA")
      :config
      (setq gptel-api-key (auth-source-pick-first-password :host "api.openai.com" :user "sk-proj")))))

And I belive it is an issue with elpaca because it works fine when I use this with the default package manager.

(use-package gptel
  :config
  (setq gptel-api-key (auth-source-pick-first-password :host "api.openai.com" :user "sk-proj")))
@progfolio
Copy link
Owner

progfolio commented Sep 25, 2024

I'm unable to reproduce using the test case you've provided.
What is the output of M-x elpaca-info for gptel in the test environment on your end? I'm interested to see if there are any byte-compilation errors. The error looks like the symptom of byte-compilation/macro expansion mismatch.

There is also an existing issue for gptel in which various users are seeing the error with other package managers. karthink/gptel#348

I don't think this is necessarily Elpaca's issue.
I would try either installing an older version of gptel (via the :tag recipe keyword) or installing a newer version of transient.

e.g. See if the error occurs in this environment:

(elpaca-test
  :interactive t
  :init
  (elpaca transient)
  (elpaca gptel))

@SeanHaz
Copy link
Author

SeanHaz commented Sep 25, 2024

When I run your test (with newer version of transient) it works so I think you're right about it being unrelated to the package manager. I also got it working on my local (with a lot more trouble) so thanks very much for your help.

I included the elpaca-info output you requested also, in case you are curious. (from an instance with the gptel-menu issue I was facing).

gptel info:

gptel [MELPA|NonGNU-devel ELPA]
Interact with ChatGPT or other LLMs

source: MELPA
url: https://github.com/karthink/gptel
menu item recipe:
( :package "gptel"
  :repo "karthink/gptel"
  :fetcher github
  :files ("*.el" "*.el.in" "dir" "*.info"
	  "*.texi" "*.texinfo" "doc/dir"
	  "doc/*.info" "doc/*.texi"
	  "doc/*.texinfo" "lisp/*.el" "docs/dir"
	  "docs/*.info" "docs/*.texi"
	  "docs/*.texinfo" (:exclude
			    ".dir-locals.el" "test.el" "tests.el"
			    "*-test.el" "*-tests.el" "LICENSE"
			    "README*" "*-pkg.el"))
  :source "MELPA")
full recipe:
( :package "gptel"
  ;; Inherited from declaration.
  :source "GNU ELPA"
  ;; Inherited from elpaca-order-functions.
  :depth 1
  :inherit t
  :protocol https
  ;; Inherited from elpaca-menu-item.
  :files (:defaults)
  :fetcher github
  :repo "karthink/gptel")
dependencies:
  emacs     >= 27.1
  transient >= 0.4.0
  compat    >= 29.1.4.1
dependents: nil
installed version: 0.9.0 462078e
statuses:
  (finished activation info byte-compilation autoloads linking unblocked blocked ref-checked-out cloning queued)
files:
  $REPOS/gptel/gptel-anthropic.el  → $BUILDS/gptel/gptel-anthropic.el
  $REPOS/gptel/gptel-context.el    → $BUILDS/gptel/gptel-context.el
  $REPOS/gptel/gptel-curl.el       → $BUILDS/gptel/gptel-curl.el
  $REPOS/gptel/gptel-gemini.el     → $BUILDS/gptel/gptel-gemini.el
  $REPOS/gptel/gptel-kagi.el       → $BUILDS/gptel/gptel-kagi.el
  $REPOS/gptel/gptel-ollama.el     → $BUILDS/gptel/gptel-ollama.el
  $REPOS/gptel/gptel-openai.el     → $BUILDS/gptel/gptel-openai.el
  $REPOS/gptel/gptel-org.el        → $BUILDS/gptel/gptel-org.el
  $REPOS/gptel/gptel-privategpt.el → $BUILDS/gptel/gptel-privategpt.el
  $REPOS/gptel/gptel-rewrite.el    → $BUILDS/gptel/gptel-rewrite.el
  $REPOS/gptel/gptel-transient.el  → $BUILDS/gptel/gptel-transient.el
  $REPOS/gptel/gptel.el            → $BUILDS/gptel/gptel.el
log:
  [2024-09-25 15:46:16] Package queued
  [2024-09-25 15:46:16] Continued by: elpaca--process
  [2024-09-25 15:46:16] Cloning
  [2024-09-25 15:46:16] $git clone --depth 1 https://github.com/karthink/gptel.git /tmp/elpaca.CtU1IO/elpaca/repos/gptel/
  [2024-09-25 15:46:16]   Cloning into '/tmp/elpaca.CtU1IO/elpaca/repos/gptel'...
  [2024-09-25 15:46:16]   remote: Enumerating objects: 20, done.        
  [2024-09-25 15:46:16]   remote: Counting objects: 100% (20/20), done.        
  [2024-09-25 15:46:16]   remote: Compressing objects: 100% (17/17), done.        
  [2024-09-25 15:46:16]   remote: Total 20 (delta 5), reused 10 (delta 0), pack-reused 0 (from 0)        
  [2024-09-25 15:46:16]   Receiving objects: 100% (20/20), 93.13 KiB | 4.43 MiB/s, done.
  [2024-09-25 15:46:16]   Resolving deltas: 100% (5/5), done.
  [2024-09-25 15:46:16] Continued by: elpaca--clone-process-sentinel
  [2024-09-25 15:46:16] Continued by: elpaca--configure-remotes
  [2024-09-25 15:46:16] Continued by: elpaca--checkout-ref
  [2024-09-25 15:46:16] Continued by: elpaca--dispatch-build-commands
  [2024-09-25 15:46:16] Queueing Dependencies
  [2024-09-25 15:46:17] Continued by: elpaca--check-status
  [2024-09-25 15:46:17] Unblocked by: compat
  [2024-09-25 15:46:17] Checking dependency versions
  [2024-09-25 15:46:17] Continued by: elpaca--check-version
  [2024-09-25 15:46:17] Linking build files
  [2024-09-25 15:46:17] Continued by: elpaca--link-build-files
  [2024-09-25 15:46:17] Build files linked
  [2024-09-25 15:46:17] Generating autoloads: /tmp/elpaca.CtU1IO/elpaca/builds/gptel
  [2024-09-25 15:46:17] $/usr/bin/emacs-gtk -Q -L /tmp/elpaca.CtU1IO/elpaca/repos/elpaca/ -l /tmp/elpaca.CtU1IO/elpaca/repos/elpaca/elpaca.el --batch --eval (progn (setq gc-cons-percentage 1.0) (elpaca-generate-autoloads "gptel" "/tmp/elpaca.CtU1IO/elpaca/builds/gptel"))
  [2024-09-25 15:46:17]     INFO     Scraping files for loaddefs... 
  [2024-09-25 15:46:17]     INFO     Scraping files for loaddefs...done
  [2024-09-25 15:46:17]     GEN      gptel-autoloads.el
  [2024-09-25 15:46:17] Continued by: #[128 "\302\301\303\300�\"\"\207" [("Autoloads Generated" nil) elpaca--process-sentinel apply append] 6 "

(fn &rest ARGS2)"]
  [2024-09-25 15:46:17] Autoloads Generated
  [2024-09-25 15:46:17] Byte compiling
  [2024-09-25 15:46:17] $/usr/bin/emacs-gtk -q --batch --eval (let ((gc-cons-percentage 1.0) (native-comp-eln-load-path '("/tmp/elpaca.CtU1IO/eln-cache/" "/usr/lib/emacs/29.4/native-lisp/"))) (dolist (dir '("/tmp/elpaca.CtU1IO/elpaca/builds/gptel" "/tmp/elpaca.CtU1IO/elpaca/builds/compat")) (let ((default-directory dir)) (add-to-list 'load-path dir) (normal-top-level-add-subdirs-to-load-path))) (byte-recompile-directory "/tmp/elpaca.CtU1IO/elpaca/builds/gptel" 0 'force))
  [2024-09-25 15:46:17]   Loading /etc/emacs/site-start.d/00debian.el (source)...
  [2024-09-25 15:46:17]   Loading /etc/emacs/site-start.d/50asymptote.el (source)...
  [2024-09-25 15:46:17]   Loading /etc/emacs/site-start.d/50autoconf.el (source)...
  [2024-09-25 15:46:17]   Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
  [2024-09-25 15:46:17]   Loading debian-ispell (native compiled elisp)...
  [2024-09-25 15:46:17]   Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
  [2024-09-25 15:46:17]   Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
  [2024-09-25 15:46:17]   Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...
  [2024-09-25 15:46:17]   Loading /usr/share/emacs/site-lisp/latex-cjk-common/cjk-enc.el (source)...
  [2024-09-25 15:46:17]   Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...
  [2024-09-25 15:46:17]   Loading /etc/emacs/site-start.d/50latexmk.el (source)...
  [2024-09-25 15:46:17]   Loading /etc/emacs/site-start.d/50texlive-lang-english.el (source)...
  [2024-09-25 15:46:17]   Checking /tmp/elpaca.CtU1IO/elpaca/builds/gptel...
  [2024-09-25 15:46:17]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-anthropic.el...
  [2024-09-25 15:46:17]   In gptel-make-anthropic:
  [2024-09-25 15:46:17]   gptel-anthropic.el:109:2: Warning: docstring wider than 80 characters
  [2024-09-25 15:46:17]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-autoloads.el...
  [2024-09-25 15:46:17]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-context.el...
  [2024-09-25 15:46:17]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-curl.el...
  [2024-09-25 15:46:17]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-gemini.el...
  [2024-09-25 15:46:17]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-kagi.el...
  [2024-09-25 15:46:17]   In gptel-make-kagi:
  [2024-09-25 15:46:17]   gptel-kagi.el:136:2: Warning: docstring wider than 80 characters
  [2024-09-25 15:46:17]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-ollama.el...
  [2024-09-25 15:46:17]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-openai.el...
  [2024-09-25 15:46:17]   In gptel-make-openai:
  [2024-09-25 15:46:17]   gptel-openai.el:163:2: Warning: docstring wider than 80 characters
  [2024-09-25 15:46:17]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-org.el...
  [2024-09-25 15:46:17]   In end of data:
  [2024-09-25 15:46:17]   gptel-org.el: Warning: the function ‘org-element-type-p’ is not known to be defined.
  [2024-09-25 15:46:18]   gptel-org.el: Warning: the function ‘org-element-parent’ is not known to be defined.
  [2024-09-25 15:46:18]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-privategpt.el...
  [2024-09-25 15:46:18]   In gptel-make-privategpt:
  [2024-09-25 15:46:18]   gptel-privategpt.el:103:2: Warning: docstring wider than 80 characters
  [2024-09-25 15:46:18]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-rewrite.el...
  [2024-09-25 15:46:18]   gptel-transient.el: Warning: (lambda nil \...) quoted with ' rather than with #'
  [2024-09-25 15:46:18]   gptel-transient.el: Warning: (lambda nil \...) quoted with ' rather than with #'
  [2024-09-25 15:46:18]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel-transient.el...
  [2024-09-25 15:46:18]   In toplevel form:
  [2024-09-25 15:46:18]   gptel-transient.el:365:7: Warning: (lambda nil \...) quoted with ' rather than with #'
  [2024-09-25 15:46:18]   gptel-transient.el:373:7: Warning: (lambda nil \...) quoted with ' rather than with #'
  [2024-09-25 15:46:18]   Compiling /tmp/elpaca.CtU1IO/elpaca/builds/gptel/gptel.el...
  [2024-09-25 15:46:18]   Done (Total of 12 files compiled, 1 skipped)
  [2024-09-25 15:46:18] Continued by: #[128 "\302\301\303\300�\"\"\207" [("Byte compilation complete" nil) elpaca--process-sentinel apply append] 6 "

(fn &rest ARGS2)"]
  [2024-09-25 15:46:18] Byte compilation complete
  [2024-09-25 15:46:18] Compiling Info files
  [2024-09-25 15:46:18] Continued by: elpaca--compile-info
  [2024-09-25 15:46:18] Info source files not found
  [2024-09-25 15:46:18] Continued by: elpaca--dispatch-build-commands
  [2024-09-25 15:46:18] Activating package
  [2024-09-25 15:46:18] Package build dir added to load-path
  [2024-09-25 15:46:18] Caching autoloads
  [2024-09-25 15:46:18] Autoloads cached
  [2024-09-25 15:46:18] Continued by: elpaca--activate-package
  [2024-09-25 15:46:18] ✓ 1.628 secs

@SeanHaz SeanHaz closed this as completed Sep 25, 2024
@progfolio
Copy link
Owner

Glad you got it working. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants