goose icon indicating copy to clipboard operation
goose copied to clipboard

Feature request: Github Copilot?

Open anderssv opened this issue 1 year ago • 4 comments

Is it possible? I am not familiar with their APIs etc.

Due to corporate policies it is the only LLM (service) that we can use on our codebases.

anderssv avatar Feb 11 '25 09:02 anderssv

@anderssv yeah would love this - as far as I know copilot models are not available yet via api (would need to ask microsoft for this). Would be good to put in a feature request with them as I agree would be great.

michaelneale avatar Feb 12 '25 06:02 michaelneale

Seems they just released a Language Server SDK, is that a viable route? https://github.blog/changelog/2025-02-10-copilot-language-server-sdk-is-now-available/

anderssv avatar Feb 12 '25 07:02 anderssv

Would be really nice as Copilot now have support for both Gemini and Claude too. 😄

anderssv avatar Feb 24 '25 12:02 anderssv

FYI Copilot uses an OpenAI compatible API, but has special auth. If someone were to build this provider there is a reference python implementation in LiteLLM that was just merged:

https://github.com/BerriAI/litellm/pull/8577

I expect one could copy the existing OpenAI provider with the custom auth mechanism from that PR and things should work!

I am in the same boat that for legal reasons we can also only use GitHub copilot and I would love to use this

rockwotj avatar Mar 09 '25 17:03 rockwotj

Some guys at aider made some workarounds exposing the internal Copilot API in VSCode as a proxy

Not sure in the long run if it's worth it (it could break anytime), and on the legal side if it's even ok but worth taking a look if you're interested

https://github.com/Aider-AI/aider/issues/2227#issuecomment-2675006637 https://github.com/Aider-AI/aider/issues/2227#issuecomment-2708095212 https://github.com/Aider-AI/aider/pull/3273

dinhphieu avatar Mar 26 '25 06:03 dinhphieu

While we wait (totally understand, wish I had the time to help), I recommend checking out VSCode Copilot Agent mode. It is similar in certain aspects, and getting ok results with it pointing it at a folder of Java/Kotlin projects: https://code.visualstudio.com/blogs/2025/02/24/introducing-copilot-agent-mode

anderssv avatar Mar 26 '25 11:03 anderssv

I added support for this in https://github.com/block/goose/pull/1926 if anyone wants to help test

rockwotj avatar Mar 30 '25 03:03 rockwotj

@rockwotj Can I help testing it?

I'm not set up for rust development, but I suppose it's not that hard to build it.

  • clone
  • checkout the branch
  • execute some building command that, after burning down my decade old I3, gives me a binary?

Or just simpler to wait for someone with dev env?

BenceBakos avatar Apr 07 '25 11:04 BenceBakos

Yeah @BenceBakos some being cargo build --release. You'll need a working rust toolchain setup, which is pretty painless with https://rustup.rs/

rockwotj avatar Apr 14 '25 01:04 rockwotj

@rockwotj

cargo build --release:

...
  = note: /usr/bin/ld: cannot find -lxcb: No such file or directory
          collect2: error: ld returned 1 exit status
          

error: could not compile `goose-server` (bin "goosed") due to 1 previous error

BenceBakos avatar Apr 14 '25 04:04 BenceBakos

I am not sure how your system is setup. github.com/copilot might be good at resolving. Assuming you're on linux you are missing libxcb

sudo apt-get install libx11-dev

Might do the trick or you need another system dependency.

You could also just build the goose cli and not build the server which I guess needs X11 support for something...

rockwotj avatar Apr 15 '25 01:04 rockwotj

@rockwotj

I did:

sudo apt-get install libx11-dev

then I got error:

error: rustc 1.79.0 is not supported by the following packages:
  [email protected] requires rustc 1.81.0
  [email protected] requires rustc 1.81.0
  [email protected] requires rustc 1.81.0
  [email protected] requires rustc 1.81.0
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.80.1
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.81
Either upgrade rustc or select compatible dependency versions with
`cargo update <name>@<current-ver> --precise <compatible-ver>`
where `<compatible-ver>` is the latest version supporting rustc 1.79.0

did this:

rustup update stable

And now I'm getting error:

error[E0463]: can't find crate for `git_version_macro`
  --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/git-version-0.3.9/src/lib.rs:26:9
   |
26 | pub use git_version_macro::{git_submodule_versions, git_version};
 

BenceBakos avatar Apr 16 '25 13:04 BenceBakos

I got the same error:

  = note: some arguments are omitted. use `--verbose` to show all linker arguments                                                                                               
  = note: /usr/bin/ld: cannot find -lxcb: No such file or directory                                                                                                              
          collect2: error: ld returned 1 exit status                                                                                                                             
                                                                                                                                                                                 
                                                                                                                                                                                 
error: could not compile `goose-cli` (bin "goose") due to 1 previous error                                                                                                       

The fix was to install libxcb1-dev

sudo apt install libxcb1-dev

SoAG avatar Apr 22 '25 04:04 SoAG

@SoAG did you test it? I am still unable to build it.

BenceBakos avatar Apr 22 '25 09:04 BenceBakos

i would love to have this feature in goose

deemkeen avatar May 06 '25 14:05 deemkeen