positron icon indicating copy to clipboard operation
positron copied to clipboard

Assistant: Issue signing into CoPilot with outgoing proxy

Open jonvanausdeln opened this issue 5 months ago • 11 comments

System details:

Positron and OS details:

Interpreter details:

Describe the issue:

From a support customer:

This customer is trying to authenticate to GitHub CoPilot in Positron Assistant, but they are getting a timeout error when trying to reach https://github.com/login/device/code

They have an outgoing proxy in place, and it looks like the *_proxy environment variables are getting set in the Positron session, but they may not be getting set in the Positron Assistant context/window

Image

Expected or desired behavior:

github.com page to open to complete sign in process.

Were there any error messages in the UI, Output panel, or Developer Tools console?

jonvanausdeln avatar Jul 22 '25 20:07 jonvanausdeln

This is where we actually spawn the language client process (or rather, pass the executable to LanguageClient which does the job):

https://github.com/posit-dev/positron/blob/4423b3bbe9a3305d9839b727e1814a3eaea54b41/extensions/positron-assistant/src/copilot.ts#L323-L329

My hypothesis is that they are setting _proxy variables via a mechanism that sets them for the terminal (and R/Python sessions) but either (a) they are not set for the extension host process, or (b) the Copilot LSP uses an HTTP client that doesn't check _proxy variables.

Possible solutions:

  • pass the LanguageClient a shell wrapper instead of the LSP executable directly, so e.g. .bash_profile gets run if that's where _proxy is getting set
  • see if there is some way to customize the executable launch in LanguageClient such that we can manually inject _proxy vars (IIRC there is a way to specify a custom launch function here, so we could start in a hidden terminal or something too)
  • manually check contributed environment variables & set them in the host process so they will be inherited
  • run away from home and live in the woods

jmcphers avatar Jul 22 '25 20:07 jmcphers

This is still an issue. The customer ticket was closed because we have this issue opened. We might need to reach out to customer support if more info is needed.

jonvanausdeln avatar Sep 04 '25 18:09 jonvanausdeln

Have the same problem here.

kv9898 avatar Sep 11 '25 01:09 kv9898

Positron and OS details:

Positron Version: 2025.10.0 (user setup) build 199 Code - OSS Version: 1.103.0 Commit: 81d0c98dbf719e29097b9c700877398d7af13138 Date: 2025-10-09T17:54:48.567Z Electron: 37.2.3 Chromium: 138.0.7204.100 Node.js: 22.17.0 V8: 13.8.500258-electron.0 OS: Windows_NT x64 10.0.26100

Hi everyone (first time writing on a GitHub issue),

I’m currently experiencing the same kind of problem using Positron version 2025.10.0-199. I noticed that I can use and connect to GitHub Copilot just fine in a normal local window. However, when I connect to a remote server via SSH, it says I’m signed in with GitHub, but I don’t get any completions or Copilot features at all.

When I try signing out and signing back in, I get the same login issue as above (failed request to https://github.com/login/device/code).

I was wondering if this is normal (i.e., if Copilot isn’t supported yet for this kind of SSH setup) or if it’s an unexpected issue.

For reference, Copilot works perfectly fine for me on VS Code with the same SSH setup.

HTilki avatar Oct 14 '25 11:10 HTilki

@HTilki I think you are running into https://github.com/posit-dev/positron/issues/8409. You need to sign in to Copilot both locally and on the server right now. We talk about this in our docs here:

If you are using Positron with a remote SSH session, you will need to authenticate to GitHub on the remote server as well. Follow along on GitHub as we make improvements in this area.

juliasilge avatar Oct 14 '25 17:10 juliasilge

That’s actually what I tried to do — I managed to sign in to GitHub (to use GitHub Pull Requests) on the remote SSH session, but when I try to sign in to Copilot, I get a timeout error.

When I try to connect to GitHub (successful) : Image

When I try to connect to connect to Copilot : Image

HTilki avatar Oct 15 '25 08:10 HTilki

@HTilki And to clarify, you also have an outgoing proxy on the server?

juliasilge avatar Oct 15 '25 18:10 juliasilge

Yes I have.

HTilki avatar Oct 16 '25 07:10 HTilki

I think we'll need to provide a way to pass proxy server info to Copilot to get this to work. This has already been done by RStudio; we can probably use similar settings and should also respect the same environment variables for consistency.

https://docs.posit.co/ide/user/2025.09.1/ide/guide/tools/copilot.html#using-github-copilot-with-proxy-servers

jmcphers avatar Oct 27 '25 18:10 jmcphers

Bumping back to triage to prioritize.

jonvanausdeln avatar Oct 27 '25 21:10 jonvanausdeln

@jmcphers assigning you for now as we may be able to resolve this via https://github.com/posit-dev/positron/issues/10491

sharon-wang avatar Nov 13 '25 18:11 sharon-wang

If we do resolve this via #10491, then customers would need to supply proxy info for Copilot as described here:

https://docs.github.com/en/copilot/how-tos/configure-personal-settings/configure-network-settings

jmcphers avatar Dec 06 '25 00:12 jmcphers