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
VSCode plugin #1
Comments
It appears so unfortunately! It is probably possible to bypass this by changing the code of the extension, but that's going a bit beyond what I'm comfortable with. You may want to check out this extension developed by some of my colleagues, which also talks to the OpenAI API, and so should be easy to use with FauxPilot: https://github.com/synoet/Pincer/tree/main/extension However, it needs a bit of updating now that the InlineCompletions API has been finalized (it was originally written for the VSCode beta). You'll probably also want to tear out the telemetry that we added for our user study. |
I think this vs code extension could be modified easily for fauxpilot. |
After some modifications to the VSCode plugin; I've managed to bypass the token and have a SINGLE autocompletion. And I couldn't manage to repeat that ever since :( |
I should have a barebones extension (code, I dunno how to upload it to marketplace) in a few hours, just teaching myself how to do so |
https://github.com/Venthe/vscode-fauxpilot This is a (very) basic implementation; as I've just hacked around. It is NOT published, but it does work :) @moyix if I would wish to publish it and work on it; can I use the name Fauxpilot? Or would you rather prefer for me not to use that name? e: https://github.com/Venthe/vscode-fauxpilot/releases/tag/0.0.1 here you have the release. It is not tested (as I did this in dev mode only). I will spend some time on it tomorrow, gotta go back to work! e2: Just confirmed working from VSIX, have fun! e3: v 0.0.2 released. Including expanded prompt, enable/disable, delay and fixed annoying bug with completion not being shown |
Sure, feel free to use the name! |
Can we update this plugin in the readme, the vscode for github copilot just does not work. |
Do you mean it doesn't work without having a valid token for Copilot? Or is something going wrong after that too? |
Yes, I also have trouble to use the Copilot vscode plugin. |
@Venthe what does max token and suggestion delay mean in your plugin? These are not very clear in the Readme. And default max token is 4, is pretty weird, I think code snippet need at least 200 token. |
I will try to find some time to test again with the most recent Copilot. Last time I checked there were issues with the tokenizers between Copilot and CodeGen being slightly different, so Copilot sometimes makes requests that are too long for CodeGen – I think this can be fixed by replacing the I have not tested this though, just very short on time now that school is back in session :( |
I can help with this since this error also appears in the official vim plugin. The plugin uses It should return a json string with Updated: I've tried out the minimal output of |
The next release of the GitLab VS code extension will have support for FauxPilot. Welcoming contributions 😄 Extension: Merge Request: |
Hey, sorry for missing this comment. To be completely honest, I do not remember why I've set it this way. This is / was a rough implementation only; just to have something working. Delay: This sets the time for the debounce-like mechanism |
After testing several extensions I ended up going with github copilot. It seems more faster,more features and smarter ,like set different stopwords in different situations.
"github.copilot.advanced": {
"model": "fastertransformer",
"debug.overrideEngine": "codegen",
"debug.testOverrideProxyUrl": "http://192.168.1.161:5000",
"debug.overrideProxyUrl": "http://192.168.1.161:5000"
},
Another thing is I must change this to |
Hi @shadowwider, where is the attached js? I also want to use GitHub copilot extension with fauxpilot server. |
https://github.com/shadowwider/brook/releases/download/v1/extension.js |
I encounter this error while using the copilot plugin |
The Copilot extension needs well formatted streaming response, but the copilot_proxy code seems to return badly formatted data. Here's an example of the streamed response:
As you can see, there's However, I think we need to make some more changes on the backend (preferrably in the fastertransformer backend, otherwise at least in the proxy) for better integration with the Copilot extension (if that's desired). For instance, currently the "stop tokens" logic is not correct ( #85 ), because of which the client gets an overly long response. In my case, 500 tokens were being returned, including logprobs. The client then just trims the result with appropriate stop tokens. This results in wasted compute and poor latency. Ideally, the stopword logic would be correctly handled in the fastertransformer backend itself, however that's not happening. |
See this and the following comment for context: #1 Signed-off-by: Parth Thakkar <thakkarparth007@gmail.com>
Update setup.sh and add a manual config for 125m.
Hello all. The comments above have been very helpful in setting up the Copilot extension. I managed to get it to work with my instance and figured I would combine the steps I used (this is for Windows. Linux installation is similar, just different locations):
This is essentially a manual override for the GitHub token retrieval to use our local instance instead.
|
@Venthe First of all thanks for making the plugin! It worked for me. I was looking at the source code for your plugin. I was wondering how much of the plugin you have adapted from Open AI Co-pilot plugin. The reason I was asking this is merely coz I want to make sure that there is no way that the extension can contact the OpenAI servers due to security policy of being able to use it at work. For example, even when we set the server address to the local codegen one using config in the OpenAI co-pilot plugin ( that is used for recommendation generation) , there were traces of code responsible for token handling that were contacting Github. I'm gonna try to read more about VSCode plugins in the meantime. Again, thanks for your plugin. |
Not at all, happy to provide. It was - and is - basically a hack done in few hours (and my first plugin for vscode); and the only parts that I've been "using" from the other repo was the actual API call. At the time there was no option to use fauxpilot in Code without severe tinkering with original copilot plugin (basically removing the token handling and more as far as I remember). At this point the plug-in for me is done as it is working fine; I'm only improving it as per feature requests though considering that Gitlab has made their own version of fauxpilot client, i believe that mine is quite obsolete at this point |
Hi @Venthe
GitLab actually (very unfortunately) dropped support for FauxPilot https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/697 It might be worth adopting some of the mechanisms from that plugin such as the debounce mechanism, yours doesn't actually work as intended. I think it would be a good idea to adopt your plugin into the FauxPilot organization since you have the plugin already published on the marketplace. WDYT? But to answer @mithandir's question, ideally the plugin for FauxPilot should adopt the interface from OpenAI in the bare bones setup so we are 100% sure no data is send to OpenAI (now or in the future). |
Sourcegraph recently open-sourced their client Cody (https://github.com/sourcegraph/sourcegraph/blob/main/client/cody/src/completions/index.ts). They're still building it, but that's also a good opportunity to contribute early enough so that there's support for FauxPilot. |
Good to know, thanks
Hahah, yeah, it does not. I've cobbled a dirty solution because the only library that I've worked with that had debounce was heavy, and I needed it to "at least" work. I knew that it will catch up to me:)
No problem with that; I can keep it in my namespace or move it to org; but this is not ultimately question for me I believe. My only "requirement" is for it to stay MIT or similar license.
Please bear in mind; that I have zero understanding about the API - that's why I've specifically noted that it was a quick job, the plug-in. I'm happy to contribute, but I'll need at least some guidance in that regard. |
hello @brandonvessel I am not able to find this occurrence https://api.github.com/copilot_internal in my extension.js file |
@AdithyaRamanChippa I have observed this change as well with the recent changes to the extension. This combability was originally confirmed by me on version v1.77.9225 of the GitHub Copilot extension. |
What are the changes you made in the extension.js, do you have a diff maybe? I'll like to implement this for 1.143.0 |
I'm sorry, I haven't had a new version for a long time and I've forgotten about it now. Maybe you could try running a git diff between my file and the corresponding official version's source file to see what changes were made; there should be very few. It's just that I removed a few parts for verifying accounts, which doesn't affect the basic logic |
Hi,I tried using the VSCode plugin using the supplied configuration, but the plugin throws the following error:
[INFO] [auth] [2022-08-03T06:47:46.784Z] Invalid copilot token: missing token: 403
[ERROR] [default] [2022-08-03T06:47:46.787Z] GitHub Copilot could not connect to server. Extension activation failed: "User not authorized"
Do we need a GitHub Copilot subscription to get a working token?
The text was updated successfully, but these errors were encountered: