Vscode with github copilot does not work

I have nixos 23.11 installed.
I want to use vscode with copilot chat.

I installed vscode from the unstable channel, vscode works.
But whenever I start the copilot chat, i get the error:
“Chat failed to load. Please ensure that the GitHub Copilot Chat extension is up to date.”
Other extensions work.

The is a log error in ~/.config/Code/logs/20240420T160037/window1/exthost/exthost.log that might have something to do with it:

2024-04-20 16:00:40.179 [error] Error: chatParticipant must be declared in package.json: workspace
at d.$registerAgent (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:2547:45309)
at f.S (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:1623:13952)
at f.Q (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:1623:13718)
at f.M (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:1623:12811)
at f.L (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:1623:12029)
at u.value (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:1623:10677)
at n.y (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:89:659)
at n.fire (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:89:876)
at s.fire (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:628:14518)
at q.onmessage (vscode-file://vscode-app/nix/store/vj4i7vb24bkkx58n7hmpx9p8cqll1fz8-vscode-1.88.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:1641:7954)

vscode was installed by configuration.nix like this:

{ config, pkgs, ... }:
let 
  nixpkgs-unstable = import <nixpkgs-unstable> { config = { allowUnfree=true;};};
in
{
.....
  environment.systemPackages = with pkgs; [
.....
    # nixpkgs-unstable.vscode
    (nixpkgs-unstable.vscode-with-extensions.override  {
      # vscode = nixpkgs-unstable.vscodium;
      vscodeExtensions = with nixpkgs-unstable.vscode-extensions; [
        github.copilot-chat
        github.copilot
        github.vscode-pull-request-github
        ms-vscode.cpptools
        ms-vscode.cmake-tools
        rust-lang.rust-analyzer
      ];
    })
  ];
.....

I have found no solution on nixos.org or in a general google search.

This is because the extension is outdated in the repo. You can either ask for it to be updated or better update it yourself and send a PR. Just fork nixpkgs, clone that and then run ./pkgs/applications/editors/vscode/extensions/update_installed_exts.sh

Alternatively, you can set up nix-vscode-extensions and always have up to date extensions.

I will try that, thank you. :slight_smile:

The script in update_installed_exts.sh does pisk a newer version. But his version is too new.
I took a look into the script. It does fetch the latest version from github.gallery.vsassets.io.

Somehow i need to get a version that suites the vscode version 1.88.1.
How can I do that ?

I used nix4vscode to get the correct version. So i have got the correct version.

2 Likes