copilot-emacs / copilot.el

An unofficial Copilot plugin for Emacs.
MIT License
1.72k stars 122 forks source link

Support for local CoPilot #190

Closed janEbert closed 8 months ago

janEbert commented 9 months ago

Hey, I'd like to do something similar to https://github.com/danielgross/localpilot, which sets github.copilot.advanced.debug.{testOverrideProxyUrl,overrideProxyUrl} to a different URL in settings.json in order to avoid having to access GitHub.

I was unable to find any way to set settings.json variables in the ELisp code. I was also unsuccessful in hardcoding the appropriate values in agent.js.

What pieces are missing to avoid the proprietary remote APIs? Or would maybe just adding a way to pass settings into the JavaScript code be enough? If the functionality for passing settings already exists, I'd be super happy if you could point me to it.


Including debug messages I added, I get the following output messages upon M-x copilot-diagnose:

Copilot agent started.
copilot--request args: ('initialize '(:capabilities (:workspace (:workspaceFolders t))))
copilot--async-request args: nil
copilot--async-request args: (:success-fn (lambda (_) (message Copilot OK.)) :error-fn (lambda (err) (message Copilot error: %S err)) :timeout-fn (lambda nil (message Copilot agent timeout.)))
Copilot error: (:code 1000 :message "Not authenticated: NotSignedIn")

The proxy I tried to hardcode in agent.js does not seem to be hit at all.

janEbert commented 9 months ago

I suppose https://github.com/danielgross/localpilot/issues/12 may be the answer to the errors I'm facing. Even overriding the proxies, I get walled off by (as of yet) unavoidable authentification.

zerolfx commented 9 months ago

@janEbert This plugin is built on copilot.vim. If the local copilot works with copilot.vim but not with copilot.el, I can look into it.

janEbert commented 8 months ago

I believe it to be an issue with the JavaScript until further notice. :) Thanks!