Closed benthamite closed 1 year ago
I just merged #88 as a potential fix.
Thanks. The commit didn't fix it, but the error is now different:
Debugger entered--Lisp error: (invalid-function (buf (current-buffer)))
(buf (current-buffer))()
copilot--get-completion(#f(compiled-function (jsonrpc-lambda-elem0) #<bytecode 0x1a0becdd23ece852>))
copilot-complete()
copilot--post-command-debounce(#<buffer *scratch*>)
apply(copilot--post-command-debounce #<buffer *scratch*>)
timer-event-handler([t 0 0 0 nil copilot--post-command-debounce (#<buffer *scratch*>) idle 0 nil])
It looks like something with the lexical-let
declaration in the copilot--async-request
macro.
error: (invalid-function (buf (current-buffer)))
I'm also encountering this error.
MacOS Ventura 13.2.1 (22D68) GNU Emacs 28.2 (build 1, aarch64-apple-darwin20.6.0, Carbon Version 164 AppKit 2202.7) of 2023-02-03 Node v18.14.1
Changing the lexical-let
to just let
gets it working for me, but I don't know enough to know if that has any consequences I don't see.
I should validate the PR before merging it.
I have reverted that commit and re-upgraded agent.js. @benthamite Please check it again.
Thanks. Alas, no luck:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p t)
jsonrpc--log-event(#<jsonrpc-process-connection jsonrpc-process-connection-a7fb3c72> (:jsonrpc "2.0" :id 2 :method "getCompletions" :params (:doc (:source "(use-package copilot\n :straight (:host github :re..." :tabSize 8 :indentSize 8 :insertSpaces :json-false :path nil :uri "" :relativePath "" :languageId "emacs-lisp" :position (:line 14 :character 1)))) client)
#f(compiled-function (arg1 &rest rest) "Send MESSAGE, a JSON object, to CONNECTION." #<bytecode 0x19c9e711dce5fcda>)(#<jsonrpc-process-connection jsonrpc-process-connection-a7fb3c72> :id 2 :method getCompletions :params (:doc (:source "(use-package copilot\n :straight (:host github :re..." :tabSize 8 :indentSize 8 :insertSpaces :json-false :path nil :uri "" :relativePath "" :languageId "emacs-lisp" :position (:line 14 :character 1))))
apply(#f(compiled-function (arg1 &rest rest) "Send MESSAGE, a JSON object, to CONNECTION." #<bytecode 0x19c9e711dce5fcda>) #<jsonrpc-process-connection jsonrpc-process-connection-a7fb3c72> (:id 2 :method getCompletions :params (:doc (:source "(use-package copilot\n :straight (:host github :re..." :tabSize 8 :indentSize 8 :insertSpaces :json-false :path nil :uri "" :relativePath "" :languageId "emacs-lisp" :position (:line 14 :character 1)))))
jsonrpc-connection-send(#<jsonrpc-process-connection jsonrpc-process-connection-a7fb3c72> :id 2 :method getCompletions :params (:doc (:source "(use-package copilot\n :straight (:host github :re..." :tabSize 8 :indentSize 8 :insertSpaces :json-false :path nil :uri "" :relativePath "" :languageId "emacs-lisp" :position (:line 14 :character 1))))
jsonrpc--async-request-1(#<jsonrpc-process-connection jsonrpc-process-connection-a7fb3c72> getCompletions (:doc (:source "(use-package copilot\n :straight (:host github :re..." :tabSize 8 :indentSize 8 :insertSpaces :json-false :path nil :uri "" :relativePath "" :languageId "emacs-lisp" :position (:line 14 :character 1))) :success-fn #f(compiled-function (result) #<bytecode 0x9f65cc1c10b6eef>) :success-fn #f(compiled-function (jsonrpc-lambda-elem0) #<bytecode 0x1a0becdd23ece852>))
jsonrpc-async-request(#<jsonrpc-process-connection jsonrpc-process-connection-a7fb3c72> getCompletions (:doc (:source "(use-package copilot\n :straight (:host github :re..." :tabSize 8 :indentSize 8 :insertSpaces :json-false :path nil :uri "" :relativePath "" :languageId "emacs-lisp" :position (:line 14 :character 1))) :success-fn #f(compiled-function (result) #<bytecode 0x9f65cc1c10b6eef>) :success-fn #f(compiled-function (jsonrpc-lambda-elem0) #<bytecode 0x1a0becdd23ece852>))
copilot--get-completion(#f(compiled-function (jsonrpc-lambda-elem0) #<bytecode 0x1a0becdd23ece852>))
copilot-complete()
copilot--post-command-debounce(#<buffer config.org (org src)>)
apply(copilot--post-command-debounce #<buffer config.org (org src)>)
timer-event-handler([t 0 0 0 nil copilot--post-command-debounce (#<buffer config.org (org src)>) idle 0 nil])
@benthamite Take a look at #70, and check the variable named copilot-log-max
.
Setting copilot-log-max
to 1000
fixed it. Thank you for the help, and for the great package!
Copilot stopped working after I rebuilt all my packages (it was working fine before). If
copilot-mode
mode is enabled, whenever it attempts to suggest a completion I get a "Process copilot agent not running: killed: 9\n" error (backtrace appended).copilot-diagnose
results in the same error.Running
node /path/to/package/dist/agent.js
produces this:Any idea what might be going on?
macOS Ventura 13.2.1 (22D68) GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin22.1.0, NS appkit-2299.00 Version 13.0.1 (Build 22A400)) of 2023-02-23 Node.js v18.14.2