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

rewrite: Wrong type argument: number-or-marker-p, nil #495

Open
1 task done
11111000000 opened this issue Dec 5, 2024 · 9 comments
Open
1 task done

rewrite: Wrong type argument: number-or-marker-p, nil #495

11111000000 opened this issue Dec 5, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@11111000000
Copy link

Please update gptel first -- errors are often fixed by the time they're reported.

  • I have updated gptel to the latest commit and tested that the issue still exists

Bug Description

on press 'd' (refactor instruction set) it always shown "Wrong type argument: number-or-marker-p, nil" and nothing happens.

Backend

OpenAI/Azure

Steps to Reproduce

M-x gptel-rewrite
d

Additional Context

GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2024-10-08

Backtrace

No response

Log Information

No response

@11111000000 11111000000 added the bug Something isn't working label Dec 5, 2024
@karthink
Copy link
Owner

karthink commented Dec 5, 2024

Please generate a backtrace. (The bug report template explains how if you're not familiar with the process.)

@11111000000
Copy link
Author

by some reason, M-x toggle-debug-on-error not show any backtrace in that case. I'll try now again.

@11111000000
Copy link
Author

11111000000 commented Dec 5, 2024

It works now:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  transient--exit-and-debug(error (wrong-type-argument number-or-marker-p nil))
  gptel--read-with-prefix("You are a js programmer.  Follow my instructions and refactor js code I provide.\n- Generate ONLY js code as output, without any explanation or markdown code fences.\n- Generate code in full, do not abbreviate or omit code.\n- Do not ask for further clarification, and make any assumptions you need to follow instructions.")
  #f(compiled-function () (interactive nil) #<bytecode 0x90aa76c53f0ab1>)()
  minibuffer-setup()
  read-string(#("Instructions (TAB to expand, M-n/M-p for next/previous): " 13 14 (face default) 14 17 (face help-key-binding) 17 29 (face default) 29 32 (face help-key-binding) 32 33 (face default) 33 36 (face help-key-binding) 36 57 (face default)) "Refactor: " transient--history)
  #f(compiled-function (prompt _ history) #<bytecode -0xef8ad428027bfd7>)(#("Instructions (TAB to expand, M-n/M-p for next/previous): " 13 14 (face default) 14 17 (face help-key-binding) 17 29 (face default) 29 32 (face help-key-binding) 32 33 (face default) 33 36 (face help-key-binding) 36 57 (face default)) nil transient--history)
  #f(compiled-function (obj) "Read a value while taking care of history.\n\nThis method is suitable for a wide variety of infix commands,\nincluding but not limited to inline arguments and variables.\n\nIf you do not use this method for your own infix class, then\nyou should likely replicate a lot of the behavior of this\nmethod.  If you fail to do so, then users might not appreciate\nthe lack of history, for example.\n\nOnly for very simple classes that toggle or cycle through a very\nlimited number of possible values should you replace this with a\nsimple method that does not handle history.  (E.g., for a command\nline switch the only possible values are \"use it\" and \"don't use\nit\", in which case it is pointless to preserve history.)" #<bytecode 0x1a3581a5b6ce0b05>)(#<gptel-lisp-variable gptel-lisp-variable-1032fdb2f040>)
  apply(#f(compiled-function (obj) "Read a value while taking care of history.\n\nThis method is suitable for a wide variety of infix commands,\nincluding but not limited to inline arguments and variables.\n\nIf you do not use this method for your own infix class, then\nyou should likely replicate a lot of the behavior of this\nmethod.  If you fail to do so, then users might not appreciate\nthe lack of history, for example.\n\nOnly for very simple classes that toggle or cycle through a very\nlimited number of possible values should you replace this with a\nsimple method that does not handle history.  (E.g., for a command\nline switch the only possible values are \"use it\" and \"don't use\nit\", in which case it is pointless to preserve history.)" #<bytecode 0x1a3581a5b6ce0b05>) #<gptel-lisp-variable gptel-lisp-variable-1032fdb2f040>)
  #f(compiled-function (&rest args) #<bytecode -0x1108cadb46eaaaf5>)(#<gptel-lisp-variable gptel-lisp-variable-1032fdb2f040>)
  #f(compiled-function (cl--cnm obj) #<bytecode 0x130cf218786eafc9>)(#f(compiled-function (&rest args) #<bytecode -0x1108cadb46eaaaf5>) #<gptel-lisp-variable gptel-lisp-variable-1032fdb2f040>)
  apply(#f(compiled-function (cl--cnm obj) #<bytecode 0x130cf218786eafc9>) #f(compiled-function (&rest args) #<bytecode -0x1108cadb46eaaaf5>) #<gptel-lisp-variable gptel-lisp-variable-1032fdb2f040>)
  #f(compiled-function (obj) "Refresh the transient buffer and call the next method.\n\nAlso wrap `cl-call-next-method' with two macros:\n- `transient--with-suspended-override' allows use of minibuffer.\n- `transient--with-emergency-exit' arranges for the transient to\n  be exited in case of an error." #<bytecode -0x549f2613f3e2c0>)(#<gptel-lisp-variable gptel-lisp-variable-1032fdb2f040>)
  apply(#f(compiled-function (obj) "Refresh the transient buffer and call the next method.\n\nAlso wrap `cl-call-next-method' with two macros:\n- `transient--with-suspended-override' allows use of minibuffer.\n- `transient--with-emergency-exit' arranges for the transient to\n  be exited in case of an error." #<bytecode -0x549f2613f3e2c0>) #<gptel-lisp-variable gptel-lisp-variable-1032fdb2f040> nil)
  transient-infix-read(#<gptel-lisp-variable gptel-lisp-variable-1032fdb2f040>)
  transient--default-infix-command()
  apply(transient--default-infix-command nil)
  #f(compiled-function (fn &rest args) (interactive nil) #<bytecode 0x1355c2274eeca22b>)(transient--default-infix-command)
  funcall-interactively(#f(compiled-function (fn &rest args) (interactive nil) #<bytecode 0x1355c2274eeca22b>) transient--default-infix-command)
  apply(funcall-interactively #f(compiled-function (fn &rest args) (interactive nil) #<bytecode 0x1355c2274eeca22b>) transient--default-infix-command)
  #[128 "\302\303\304!\203\13\0\305\202\f\0\306\300\3#\207" [#[385 "\304\305\300\301\302$\216\306\33\307\2\2\"*\207" [(#0) gptel--infix-rewrite-extra #s(transient-prefix #s(transient-prefix eieio--unbound gptel-rewrite eieio--unbound nil eieio--unbound eieio--unbound eieio--unbound nil nil 0 nil nil nil nil nil nil eieio--unbound nil nil nil eieio--unbound nil eieio--unbound nil nil nil) gptel-rewrite 4 nil eieio--unbound nil eieio--unbound nil (nil) 0 nil nil nil nil nil nil eieio--unbound nil nil nil eieio--unbound nil eieio--unbound nil nil nil) debugger make-closure #[0 "\303\302\304\"\211\203\20\0\305\306!\210\211\301!\210\210\307\301\300\242\"\210\310\302\304\311#\207" [V0 V1 V2 eieio-oref unwind-suffix transient--debug unwind-command advice-remove eieio-oset nil] 4] transient--exit-and-debug apply] 7 "\n\n(fn FN &rest ARGS)" nil] '#[257 "\304C\305\306\2\300\301\302%\216\307\33\310\2!)\1\311\240)\210\207" [(#0) gptel--infix-rewrite-extra #s(transient-prefix #s(transient-prefix eieio--unbound gptel-rewrite eieio--unbound nil eieio--unbound eieio--unbound eieio--unbound nil nil 0 nil nil nil nil nil nil eieio--unbound nil nil nil eieio--unbound nil eieio--unbound nil nil nil) gptel-rewrite 4 nil eieio--unbound nil eieio--unbound nil (nil) 0 nil nil nil nil nil nil eieio--unbound nil nil nil eieio--unbound nil eieio--unbound nil nil nil) debugger t make-closure #[0 "\300\242\205!\0\304\303\305\"\211\203\25\0\306\307!\210\211\302!\210\210\310\302\301\242\"\210\311\303\305\312#\207" [V0 V1 V2 V3 eieio-oref unwind-suffix transient--debug unwind-interactive advice-remove eieio-oset nil] 4] transient--exit-and-debug advice-eval-interactive-spec nil] 8 "\n\n(fn SPEC)"] apply called-interactively-p any funcall-interactively funcall] 5 cconv--interactive-helper](transient--default-infix-command)
  apply(#[128 "\302\303\304!\203\13\0\305\202\f\0\306\300\3#\207" [#[385 "\304\305\300\301\302$\216\306\33\307\2\2\"*\207" [(#0) gptel--infix-rewrite-extra #s(transient-prefix #s(transient-prefix eieio--unbound gptel-rewrite eieio--unbound nil eieio--unbound eieio--unbound eieio--unbound nil nil 0 nil nil nil nil nil nil eieio--unbound nil nil nil eieio--unbound nil eieio--unbound nil nil nil) gptel-rewrite 4 nil eieio--unbound nil eieio--unbound nil (nil) 0 nil nil nil nil nil nil eieio--unbound nil nil nil eieio--unbound nil eieio--unbound nil nil nil) debugger make-closure #[0 "\303\302\304\"\211\203\20\0\305\306!\210\211\301!\210\210\307\301\300\242\"\210\310\302\304\311#\207" [V0 V1 V2 eieio-oref unwind-suffix transient--debug unwind-command advice-remove eieio-oset nil] 4] transient--exit-and-debug apply] 7 "\n\n(fn FN &rest ARGS)" nil] '#[257 "\304C\305\306\2\300\301\302%\216\307\33\310\2!)\1\311\240)\210\207" [(#0) gptel--infix-rewrite-extra #s(transient-prefix #s(transient-prefix eieio--unbound gptel-rewrite eieio--unbound nil eieio--unbound eieio--unbound eieio--unbound nil nil 0 nil nil nil nil nil nil eieio--unbound nil nil nil eieio--unbound nil eieio--unbound nil nil nil) gptel-rewrite 4 nil eieio--unbound nil eieio--unbound nil (nil) 0 nil nil nil nil nil nil eieio--unbound nil nil nil eieio--unbound nil eieio--unbound nil nil nil) debugger t make-closure #[0 "\300\242\205!\0\304\303\305\"\211\203\25\0\306\307!\210\211\302!\210\210\310\302\301\242\"\210\311\303\305\312#\207" [V0 V1 V2 V3 eieio-oref unwind-suffix transient--debug unwind-interactive advice-remove eieio-oset nil] 4] transient--exit-and-debug advice-eval-interactive-spec nil] 8 "\n\n(fn SPEC)"] apply called-interactively-p any funcall-interactively funcall] 5 cconv--interactive-helper] transient--default-infix-command nil)
  gptel--infix-rewrite-extra()
  funcall-interactively(gptel--infix-rewrite-extra)
  command-execute(gptel--infix-rewrite-extra)

@11111000000
Copy link
Author

11111000000 commented Dec 5, 2024

and minibuffer stuck in transient (can't exit whithout C-]): ```Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) nil)
transient--exit-and-debug(error (wrong-type-argument (or eieio-object cl-structure-object oclosure) nil))
eieio-oref(nil command)
transient--post-command()

@karthink
Copy link
Owner

karthink commented Dec 6, 2024

What is the value of the variable max-mini-window-height in your Emacs session?

@11111000000
Copy link
Author

Its value is nil
Original value was 0.25

@11111000000
Copy link
Author

set to 1 helps

karthink added a commit that referenced this issue Dec 6, 2024
* gptel-transient.el (gptel--read-with-prefix): Use a value of 0.4
for `max-mini-window-height' if it is not set. (#495)
@karthink
Copy link
Owner

karthink commented Dec 6, 2024 via email

@karthink
Copy link
Owner

karthink commented Dec 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants