Comments (19)
Seconding this. I do wonder if it might be possible to pull some hostsfile trickery with the existing intellij plugin to redirect requests to the local inference server instead.
from fauxpilot.
You may want to dig into the code of the Copilot IntelliJ plugin to see if they have a similar debug setting to debug.overrideProxyUrl
and debug.overrideEngine
in the VSCode plugin? But yes, would also be great to have our own customizable IntelliJ plugin for FauxPilot as well :)
from fauxpilot.
One more thing, when checking whether the versions of IDEA and Github Copilot are affected, I updated Github Copilot to the latest version 1.4.4.3955. Then I read the code of agent.js
and found that debug.overrideProxyUrl
already supports setting in environment variables. π (Search setOverridesFromEnvironment()
to view the definition of the function)
Currently, there are only 3 supported parameters ["DebugOverrideEngine", "DebugOverrideProxyUrl", "DebugOverrideCapiUrl"]
. For example, if you want to set debug.overrideProxyUrl
, just set AGENT_DEBUG_OVERRIDE_PROXY_URL
in the environment variable.
Combined with the solution proposed by @vibin to use agent.js
to run the plug-in, theoretically, we can specify in JetBrains
all the advanced parameter settings configurable in VSCode
.
from fauxpilot.
anyone worked on Intellij plugin successfully?
from fauxpilot.
hi @vibin , I'm glad to see the solution you proposed.
I tried it locally. After I performed the second step (renaming the binary agent file in the /bin directory) and before performing the third step, I tried to start the IDE to verify the Copilot plug-in. When executing the agent.js file, I found that the status of the Copilot plug-in was abnormal, showing "not signed in to github". This seems inconsistent with what is stated in your scenario.
Step 2 is required, since the IntelliJ plugin uses agent.js only when it cannot find the binaries.
I am currently using IDEA version 21.3.3 and the GitHub Copilot plug-in version 1.2.9.2684. I am not sure whether this is related to the IDE and plug-in version. Can I ask you whether this solution can still be used? It would be great if you could tell me your IDE version and plug-in version.β
I figured it out, it was a problem with the local nodeJS version.
Since I am maintaining an old nodeJS project, my local default node version is node8, so when I manually run node agent.js
, an error will also be reported. When I switch to node16, node agent.js
starts normally. So when I switch the system's default nodeJS version to 16, and then start IDEA, I can run the plugin using agent.js as expected.
from fauxpilot.
@moyix are you aware of any opensource implementation that we could use to build the Intellij plugin for fauxpilot?
from fauxpilot.
@Xelef2000 I know you have suggested for vscode plugin https://github.com/hieunc229/copilot-clone.
Are you aware of anything equivalent for Intellij plugin?
from fauxpilot.
I took a quick look at the plugin code -- the code does seem to look for debug.overrideProxyUrl
and debug.overrideEngine
variables in "advanced" configuration, just like vscode. Now, I am not an intellij user so I don't know how to get to such advanced/custom configuration UI, but based on these references, I'm assuming there exists one. If that's not the case, please reopen this.
Side note: Both intellij and neo-vim copilot plugins have a thin wrapper that effectively calls common JS code (the same as used by VSCode extension).
When/if you do find the place to set these variables, here are the typical values for them if you're using Fauxpilot with default settings:
debug.overrideProxyUrl
should be set to http://localhost:5000
debug.overrideEngine
should be set to codegen
from fauxpilot.
Has anyone found the overrideProxyUrl configuration on Intellij ?
from fauxpilot.
The advanced options appear in the Jetbrains' copilot plugin source code do not seem to work anywhere. Maybe it is just a residue from code project migration. Jetbrains IDE use something like XML for software settings, and Copilot plugin does not seem to offer interfaces for changing debug options in such config files.
from fauxpilot.
I took a quick look at the plugin code -- the code does seem to look for
debug.overrideProxyUrl
anddebug.overrideEngine
variables in "advanced" configuration, just like vscode. Now, I am not an intellij user so I don't know how to get to such advanced/custom configuration UI, but based on these references, I'm assuming there exists one. If that's not the case, please reopen this.Side note: Both intellij and neo-vim copilot plugins have a thin wrapper that effectively calls common JS code (the same as used by VSCode extension).
When/if you do find the place to set these variables, here are the typical values for them if you're using Fauxpilot with default settings:
debug.overrideProxyUrl
should be set tohttp://localhost:5000
debug.overrideEngine
should be set tocodegen
I've tried to replace agent.js
in intellij copilot plugin according to #72, to replace all proxy address to local ones, but when I restart IDE I could still see from network probe that the plugin is connecting to GitHub copilot proxy server. I do not know how these program works, but it seems that intellj use compiled and packed executables, so these server address are hard-coded into the plugin and could not be replaced.
from fauxpilot.
While the IntelliJ plugin does use the same agent.js to fetch completions from /engines/copilot-codex, it doesn't support debug.overrideProxyUrl
.
Yes, you can override system proxy directly in IntelliJ itself, but Copilot throws errors related to self-signed certificates.
As a last resort, I modified the plugin source code and got it working.
Steps to follow:
- Go to the plugin's folder. In my case (Mac, Android Studio), it's at:
~/Library/Application Support/Google/AndroidStudioPreview2023.1/plugins/github-copilot-intellij
- Rename the binaries under copilot-agent/bin folder. Just add some suffix to all the file names
- Open copilot-agent/agent.js in a text editor and make following changes:
a. Replace "https://copilot-proxy.githubusercontent.com" with your localhost url
b. Replace "https://copilot-telemetry.githubusercontent.com/telemetry" with your localhost url
Step 2 is required, since the IntelliJ plugin uses agent.js only when it cannot find the binaries.
from fauxpilot.
Hello @vibin, did you manage to get it working on the current version of PyCharm? it's currently 1 AM here and I've been trying everything from using an old version of the plugin to reading the source code of the plugin, without success...
from fauxpilot.
@bananasmoothii the approach which I mentioned should work for all Jetbrains IDEs - I don't think Pycharm is any different.
I have tested in the following IDEs: IntelliJ Ultimate, IntelliJ Community, Android Studio, WebStorm
from fauxpilot.
When I wrote this, I was getting 404 errors but I then found out that it was because the sent prompt was too long, now I have issues where it sometimes takes 3 minutes to respond, although sometimes it takes less than a second. Then I have issues where the server apparently doesn't produce valid JSON, and when looking at the data I had a response with multiple data: ...
and one data: [STOP]
(it may not be "stop", I don't recall)
This is too unreliable, so instead I now just have a small python script using the openai api and I copy paste code around.
from fauxpilot.
hi @vibin , I'm glad to see the solution you proposed.
I tried it locally. After I performed the second step (renaming the binary agent file in the /bin directory) and before performing the third step, I tried to start the IDE to verify the Copilot plug-in. When executing the agent.js file, I found that the status of the Copilot plug-in was abnormal, showing "not signed in to github". This seems inconsistent with what is stated in your scenario.
Step 2 is required, since the IntelliJ plugin uses agent.js only when it cannot find the binaries.
I am currently using IDEA version 21.3.3 and the GitHub Copilot plug-in version 1.2.9.2684. I am not sure whether this is related to the IDE and plug-in version. Can I ask you whether this solution can still be used? It would be great if you could tell me your IDE version and plug-in version.
β
from fauxpilot.
hi @vibin , I'm glad to see the solution you proposed.
I tried it locally. After I performed the second step (renaming the binary agent file in the /bin directory) and before performing the third step, I tried to start the IDE to verify the Copilot plug-in. When executing the agent.js file, I found that the status of the Copilot plug-in was abnormal, showing "not signed in to github". This seems inconsistent with what is stated in your scenario.
Step 2 is required, since the IntelliJ plugin uses agent.js only when it cannot find the binaries.
I am currently using IDEA version 21.3.3 and the GitHub Copilot plug-in version 1.2.9.2684. I am not sure whether this is related to the IDE and plug-in version. Can I ask you whether this solution can still be used? It would be great if you could tell me your IDE version and plug-in version.β
@wanyukang Yes, we use this solution in our org. It's tested and working for ~200 developers (IntelliJ, Android Studio)
Have you tried signing into Github with the binary agent flow disabled?
Regarding versions, I think anything latest or near to latest should be fine. For example, try copilot-intellij/1.4.3.3913 and JetBrains-IU/232.10227.8. IntelliJ 21.3.3 is 2 years old, so that could be an issue...
from fauxpilot.
@vibin Thanks for your quick reply. I did try to log into GitHub after disabling the binary, but instead of showing the login window, the plugin threw an error saying "GitHub Copilot: Failed to initiate the GitHub login process. Please try again." I plan to try upgrading my version of IDEA and the version of the GitHub Copilot plugin to see if this is the problem.
from fauxpilot.
hi @vibin , I'm glad to see the solution you proposed.
I tried it locally. After I performed the second step (renaming the binary agent file in the /bin directory) and before performing the third step, I tried to start the IDE to verify the Copilot plug-in. When executing the agent.js file, I found that the status of the Copilot plug-in was abnormal, showing "not signed in to github". This seems inconsistent with what is stated in your scenario.
Step 2 is required, since the IntelliJ plugin uses agent.js only when it cannot find the binaries.
I am currently using IDEA version 21.3.3 and the GitHub Copilot plug-in version 1.2.9.2684. I am not sure whether this is related to the IDE and plug-in version. Can I ask you whether this solution can still be used? It would be great if you could tell me your IDE version and plug-in version.β
I figured it out, it was a problem with the local nodeJS version.
Since I am maintaining an old nodeJS project, my local default node version is node8, so when I manually run
node agent.js
, an error will also be reported. When I switch to node16,node agent.js
starts normally. So when I switch the system's default nodeJS version to 16, and then start IDEA, I can run the plugin using agent.js as expected.
@wanyukang Good catch! Yes, most of our developers are on Node16 (we wrote a shell script which installs Node16 if it is not present on the system, before making changes to the plugin).
from fauxpilot.
Related Issues (20)
- Support arm64 to minimize cost
- Maybe add windows/etc installer all-in-one in this project's 'releases'.
- 400 Bad Request when file has around 100 lines of code HOT 3
- C# support! HOT 2
- 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):
- It was working fine before... HOT 1
- Support for AMD GPUs HOT 1
- Triton doesnt exist anymore I think? HOT 3
- K8s deployment (via helm chart) HOT 2
- Caught signal 11 (Segmentation fault: address not mapped to object at address (nil)) HOT 1
- why my response are all !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! HOT 3
- Can I merge images of triton and client into oneοΌeg fastertransformer_backend get content_fetch <fastertransformer&client>in CMakeLists ? HOT 1
- help me HOT 1
- What is the comparison of these model in huggingface? HOT 2
- Python Backend: "Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0" HOT 2
- [promptlib] proxy {"cause":{}} HOT 1
- ollama HOT 2
- Company Proxy HOT 1
- is documentation outdated?
- Jetbrains Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fauxpilot.