positron icon indicating copy to clipboard operation
positron copied to clipboard

GitHub Co-Pilot Support

Open petetronic opened this issue 2 years ago • 5 comments

Investigate how we can support GitHub Co-Pilot

petetronic avatar Apr 18 '23 18:04 petetronic

Notes: Microsoft's Copilot extension is currently only licensed for use in Visual Studio Code (the Microsoft commercial version, not the open source core or forks like VS Codium).

jmcphers avatar Jan 22 '24 23:01 jmcphers

Can you share installation instructions? I installed manually the latest Copilot, but after inputing auth code on GitHub and authorising the app, I am getting "User not authorized" all the time.

2024-06-28 00:50:07.838 [info] [auth] Invalid copilot token: missing token: 404 
2024-06-28 00:50:08.329 [error] [auth] Extension activation failed: "User not authorized"
2024-06-28 00:50:11.064 [error] [auth] Retrying auth
2024-06-28 00:50:25.900 [info] [auth] Invalid copilot token: missing token: 404 
2024-06-28 00:50:25.909 [info] [auth] Invalid copilot token: missing token: 404 
2024-06-28 00:50:25.910 [error] [auth] Extension activation failed: "User not authorized"
2024-06-28 00:50:25.924 [info] [auth] Invalid copilot token: missing token: 404 
Screenshot 2024-06-28 at 00 50 29

e-kotov avatar Jun 27 '24 22:06 e-kotov

The Copilot extension is only formally supported (and licensed to run) inside Visual Studio Code, so it will not authenticate in Positron. We're well aware that lots of folks want to use Copilot in Positron and are working on a solution.

jmcphers avatar Jun 28 '24 00:06 jmcphers

Notes:

It'd be really nice to be able to use Microsoft's Copilot extension (with their blessing). It is already possible to do this if you are willing to download the extension yourself. See our wiki writeup: https://connect.posit.it/positron-wiki/using-copilot.html

Note however that Copilot Chat does not work. #2010

This link appears to be limit to posit staff only. Can you make it available to all?

I was able to install the Github Copilot extension by downloading the .visx and installing it manually, but it doesn't seem to be working despite signing in successfully.

jzadra avatar Jul 04 '24 00:07 jzadra

Sorry, that comment is outdated and I've removed it. It is no longer possible to do this with Positron, unfortunately. We'll let you know as soon as we have more information.

jmcphers avatar Jul 04 '24 00:07 jmcphers

Hello, Do you have any updates on this? Since few days there is also a free plan that can be used within VSCode. Thanks

marcozanotti avatar Dec 19 '24 06:12 marcozanotti

No; the issue with integrating Copilot into Positron is related to licensing, not cost.

jmcphers avatar Dec 19 '24 16:12 jmcphers

Yes, I see that. But is there any plan to solve the issue anytime soon?

marcozanotti avatar Dec 19 '24 17:12 marcozanotti

Is there no other way to hook into Copilot? Somehow PyCharm does it. Even RStudio has rudimentary support. Does it have to be the official Copilot extension when it comes to Positron?

travis-leith avatar May 15 '25 05:05 travis-leith

Does the open sourcing of Copilot codebase affect this in any way?

This would be really nice.

ran-codes avatar Jun 17 '25 14:06 ran-codes

Microsoft has said that they will open source the extension but they haven't actually done it yet, so some details are unclear. But we do expect that we'll be able to get full Copilot support at some point after that's done.

Note that even without this, Positron already has Copilot support (for autocomplete) via the SDK Microsoft released previously. Here's how to enable Copilot in Positron.

jmcphers avatar Jun 17 '25 15:06 jmcphers

@jmcphers is this the open source repo we have been waiting for? https://github.com/microsoft/vscode-copilot-chat

travis-leith avatar Jul 09 '25 11:07 travis-leith

Yes, we have been looking at this for the last week or so! It can't just be dropped into Positron as-is, but it will make it easier for us to integrate Copilot features.

jmcphers avatar Jul 09 '25 15:07 jmcphers

I'm wondering if you all might have a solution to this--I'm trying to use Positron Assistant to connect to GitHub Copilot, but when I try to click 'sign in', it throws an error saying it couldn't connect with the server. For additional context, I have no problem signing in for GitHub Pull Requests and had no issue connecting to Copilot on VSCode. I run CachyOS (flavor of Arch Linux).

I'll attach two screenshots of error/output.

Image Image

patrickkoval avatar Jul 30 '25 19:07 patrickkoval

@patrickkoval you're not using a proxy or vpn or anything, are you? https://github.com/posit-dev/positron/issues/8623

jmcphers avatar Jul 30 '25 19:07 jmcphers

@jmcphers No, nothing like that. I tried both the 2.4Ghz/5Ghz versions of my wifi and wired. Wired provides a similar error with some new text ("write EPIPE"):

Image

Edit: I realized I run tailscale and syncthing to sync files but even after turning these off/rebooting I get the same error/s. Edit 2: In the meantime, Windsurf offers unlimited completions in their free version, so that's a workaround if anyone's interested in that.

patrickkoval avatar Jul 30 '25 19:07 patrickkoval

I'm experiencing the same issue reported by @patrickkoval.

I’ve already tried disabling the VPN, firewall, and all extensions — no change.

Error message:

[61980:0811/183856.116550:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[61980:0811/183900.581879:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[61980:0811/183900.592392:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

Session Info:

Positron Version: 2025.08.0 build 130
Code - OSS Version: 1.102.0
Commit: 76ddce53e85437b013671fe7d91a3a1c54f48341
Date: 2025-08-01T20:12:54.670Z (1 wk ago)
Electron: 35.6.0
Chromium: 134.0.6998.205
Node js: 2215.1
V8: 13.4.114.21-electron.0
0S: Linux x64 6.15.9-arch1-1

Screenshots:

First Sign in attempt:

Image

Second Sign in attempt (same session):

Image Image

danielvartan avatar Aug 11 '25 21:08 danielvartan

I notice that @patrickkoval and @danielvartan are both on flavors of Linux desktop, but we just checked and confirmed that signing in for GH Copilot completions does work on Linux desktop (Ubuntu 24.04).

juliasilge avatar Aug 11 '25 23:08 juliasilge

I notice that @patrickkoval and @danielvartan are both on flavors of Linux desktop, but we just checked and confirmed that signing in for GH Copilot completions does work on Linux desktop (Ubuntu 24.04).

Seems like me and @danielvartan both use Arch so I wonder if there's some bug specific to that distribution vs. Ubuntu.

I believe this is the only version available from the arch user repository. I'm not sure if this was also what @danielvartan installed, but this might be the key (missing dependencies or something of that nature?): https://aur.archlinux.org/packages/positron-ide-devel-bin

patrickkoval avatar Aug 12 '25 00:08 patrickkoval

I believe this is the only version available from the arch user repository. I'm not sure if this was also what @danielvartan installed, but this might be the key (missing dependencies or something of that nature?): aur.archlinux.org/packages/positron-ide-devel-bin

Yep, that’s the one (positron-ide-devel-bin 2025.08.0.130-1).

AUR also have positron-bin 0.3.0-2, but this is related to other software.

I also suspect that some dependency may be missing. Here is the PKGBUILD for reference:

# Maintainer: leothelion <ponte-vecchio>

pkgname=positron-ide-devel-bin
_pkgname=positron-ide
pkgver=2025.08.0.130
pkgver_url=2025.08.0-130
pkgrel=1
pkgdesc="A next-generation data science IDE. Positron is an extensible, polyglot tool for writing code and exploring data in Python, R, and other languages."
arch=('x86_64' 'aarch64')
options=('!debug')
url="https://github.com/posit-dev/positron"
posit_url="https://cdn.posit.co/positron/dailies/deb"
licence=('Elastic-2.0')
license=('Elastic-2.0')
depends=(
    'ca-certificates'
    'alsa-lib'
    'at-spi2-core'
    'atkmm'
    # 'glibc' # mesa
    # 'cairo' # pango
    'libcups'
    'curl'
    # 'libdrm' # mesa
    # 'expat' # mesa
    'mesa'
    # 'glib2' # pango
    'krb5'
    'gtk3'
    'gtk4'
    # 'nspr' # nss
    'nss' 
    'pango'
    # 'gcc-libs' # mesa
    # 'libx11' # mesa, pango
    # 'libxcb' # mesa
    'libxcomposite'
    'libxdamage'
    # 'libxext' # mesa
    # 'libxfixes' # mesa
    'libxkbcommon'
    # 'libxkbfile' # mesa
    'libxrandr'
    'xdg-utils'
    # python modules
    'ipython'
    'jupyter-nbclient'
    'jupyter-nbformat'
    'python-argcomplete'
    'python-asttokens'
    'python-cffi'
    'python-chardet'
    'python-colorama'
    'python-comm'
    'python-dateutil'
    'python-decorator'
    'python-docutils'
    'python-executing'
    'python-gobject'
    'python-greenlet'
    'python-importlib-metadata'
    'python-ipykernel'
    'python-jupyter-client'
    'python-jupyter-core'
    'python-markdown-it-py'
    'python-matplotlib-inline'
    'python-msgpack'
    'python-nest-asyncio'
    'python-numpy'
    'python-parso'
    'python-pexpect'
    'python-pickleshare'
    'python-pillow'
    'python-pip'
    'python-platformdirs'
    'python-pluggy'
    'python-prompt_toolkit'
    'python-psutil'
    'python-ptyprocess'
    'python-pure-eval'
    'python-pygments'
    'python-pyparsing'
    'python-pyqt5'
    'python-pytest'
    'python-pytz'
    'python-pyzmq'
    'python-requests'
    'python-six'
    'python-sphinx'
    'python-stack-data'
    'python-tomlkit'
    'python-tornado'
    'python-traitlets'
    'python-twisted'
    'python-typing_extensions'
    'python-wcwidth'
    'python-websockets'
    'python-wheel'
    'python-yaml'
    'python-zipp'
)
optdepends=(
    'vulkan-intel: Intel Vulkan driver'
    'vulkan-radeon: Radeon Vulkan driver'
    'vulkan-icd-loader: Vulkan ICD loader'
    'bash-completion: Bash completion support'
    'zsh-completions: Zsh completion support'
    'nodejs: Extra functionality for Positron'
)
provides=("positron")
conflicts=("positron-bin")
source_aarch64=("${posit_url}/arm64/Positron-${pkgver_url}-arm64.deb")
source_x86_64=("${posit_url}/x86_64/Positron-${pkgver_url}-x64.deb")
sha256sums_aarch64=('ccdb7ee3404b1d1e3c83466163c283a4f55dcdc3825bb22c977240e279418ac7')
sha256sums_x86_64=('be310e430dfe02800703ecd1df0e7a87590ab8d32c03e58b2bac4a115bcca925')

package(){
    shopt -s extglob

    msg "Converting .deb package"
    if [ "${CARCH}" = "x86_64" ]; then
        ar x Positron-${pkgver_url}-x64.deb
    elif [ "${CARCH}" = "aarch64" ]; then
        ar x Positron-${pkgver_url}-arm64.deb
    fi

    cd "${srcdir}"
    tar --extract --xz --file data.tar.xz -C "${pkgdir}"

    # copy licence from root directory
    # msg "Copying licence"
    # install -Dm644 "../LICENCE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

    msg "Installing"
    install -d "${pkgdir}/usr/share/appdata"
    install -d "${pkgdir}/usr/share/applications"
    install -d "${pkgdir}/usr/share/mime/packages"
    install -d "${pkgdir}/usr/share/positron"
}

danielvartan avatar Aug 12 '25 02:08 danielvartan

@juliasilge , the issue stems from the version of the Copilot Language Server bundled with Positron. You can fix it easily:

  1. Download the latest Copilot Language Server binary and unzip it.
  2. Replace Positron’s bundled copilot-language-server binary, located at /usr/share/positron/resources/app/extensions/positron-assistant/resources/copilot, with the new one.
  3. Launch Positron and log in to GitHub.

I’m not sure why it’s working on Ubuntu. The new version of Positron just needs the language server to be updated.

danielvartan avatar Aug 30 '25 22:08 danielvartan

@danielvartan @patrickkoval thank you both for your investigation and suggested fix 🙌 We've opened https://github.com/posit-dev/positron/issues/9255 to track the task of bumping copilot-language-server. Please follow along there for updates!

sharon-wang avatar Sep 02 '25 16:09 sharon-wang

The team has added initial preview support for both GitHub Copilot (inline completions) and GitHub Copilot Chat, which will be made available in the next stable release, Positron 2025.10.0.

Image

jthomasmock avatar Oct 02 '25 00:10 jthomasmock