copilot: Fix Copilot fails to sign in on newer versions (#36195)

Follow-up for #36093 and
https://github.com/zed-industries/zed/pull/36138

Since v1.355.0, `@github/copilot-language-server` has stopped responding
to `CheckStatus` requests if a `DidChangeConfiguration` notification
hasn’t been sent beforehand. This causes `CheckStatus` to remain in an
await state until it times out, leaving the connection stuck for a long
period before finally throwing a timeout error.

```rs
let status = server
    .request::<request::CheckStatus>(request::CheckStatusParams {
        local_checks_only: false,
    })
    .await
    .into_response() // bails here with ConnectionResult::Timeout
    .context("copilot: check status")?;
````

This PR fixes the issue by sending the `DidChangeConfiguration`
notification before making the `CheckStatus` request. It’s just an
ordering change i.e. no other LSP actions occur between these two calls.
Previously, we only updated our internal connection status and UI in
between.

Release Notes:

- Fixed an issue where GitHub Copilot could get stuck and fail to sign
in.
This commit is contained in:
smit 2025-08-14 23:28:15 +05:30 committed by GitHub
parent 1a169e0b16
commit 2acfa5e948
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 83 additions and 84 deletions

View file

@ -4,7 +4,7 @@ use futures::StreamExt;
use gpui::AsyncApp;
use language::{LanguageToolchainStore, LspAdapter, LspAdapterDelegate};
use lsp::{LanguageServerBinary, LanguageServerName};
use node_runtime::NodeRuntime;
use node_runtime::{NodeRuntime, VersionStrategy};
use project::{Fs, lsp_store::language_server_settings};
use serde_json::json;
use smol::fs;
@ -107,8 +107,7 @@ impl LspAdapter for CssLspAdapter {
Self::PACKAGE_NAME,
&server_path,
&container_dir,
&version,
Default::default(),
VersionStrategy::Latest(version),
)
.await;

View file

@ -12,7 +12,7 @@ use language::{
LspAdapter, LspAdapterDelegate,
};
use lsp::{LanguageServerBinary, LanguageServerName};
use node_runtime::NodeRuntime;
use node_runtime::{NodeRuntime, VersionStrategy};
use project::{Fs, lsp_store::language_server_settings};
use serde_json::{Value, json};
use settings::{KeymapFile, SettingsJsonSchemaParams, SettingsStore};
@ -344,8 +344,7 @@ impl LspAdapter for JsonLspAdapter {
Self::PACKAGE_NAME,
&server_path,
&container_dir,
&version,
Default::default(),
VersionStrategy::Latest(version),
)
.await;

View file

@ -13,7 +13,7 @@ use language::{LanguageName, ManifestName, ManifestProvider, ManifestQuery};
use language::{Toolchain, WorkspaceFoldersContent};
use lsp::LanguageServerBinary;
use lsp::LanguageServerName;
use node_runtime::NodeRuntime;
use node_runtime::{NodeRuntime, VersionStrategy};
use pet_core::Configuration;
use pet_core::os_environment::Environment;
use pet_core::python_environment::PythonEnvironmentKind;
@ -205,8 +205,7 @@ impl LspAdapter for PythonLspAdapter {
Self::SERVER_NAME.as_ref(),
&server_path,
&container_dir,
&version,
Default::default(),
VersionStrategy::Latest(version),
)
.await;

View file

@ -5,7 +5,7 @@ use futures::StreamExt;
use gpui::AsyncApp;
use language::{LanguageName, LanguageToolchainStore, LspAdapter, LspAdapterDelegate};
use lsp::{LanguageServerBinary, LanguageServerName};
use node_runtime::NodeRuntime;
use node_runtime::{NodeRuntime, VersionStrategy};
use project::{Fs, lsp_store::language_server_settings};
use serde_json::{Value, json};
use smol::fs;
@ -112,8 +112,7 @@ impl LspAdapter for TailwindLspAdapter {
Self::PACKAGE_NAME,
&server_path,
&container_dir,
&version,
Default::default(),
VersionStrategy::Latest(version),
)
.await;

View file

@ -10,7 +10,7 @@ use language::{
LspAdapterDelegate,
};
use lsp::{CodeActionKind, LanguageServerBinary, LanguageServerName};
use node_runtime::NodeRuntime;
use node_runtime::{NodeRuntime, VersionStrategy};
use project::{Fs, lsp_store::language_server_settings};
use serde_json::{Value, json};
use smol::{fs, lock::RwLock, stream::StreamExt};
@ -588,8 +588,7 @@ impl LspAdapter for TypeScriptLspAdapter {
Self::PACKAGE_NAME,
&server_path,
&container_dir,
version.typescript_version.as_str(),
Default::default(),
VersionStrategy::Latest(version.typescript_version.as_str()),
)
.await;

View file

@ -4,7 +4,7 @@ use collections::HashMap;
use gpui::AsyncApp;
use language::{LanguageName, LanguageToolchainStore, LspAdapter, LspAdapterDelegate};
use lsp::{CodeActionKind, LanguageServerBinary, LanguageServerName};
use node_runtime::NodeRuntime;
use node_runtime::{NodeRuntime, VersionStrategy};
use project::{Fs, lsp_store::language_server_settings};
use serde_json::Value;
use std::{
@ -115,8 +115,7 @@ impl LspAdapter for VtslsLspAdapter {
Self::PACKAGE_NAME,
&server_path,
&container_dir,
&latest_version.server_version,
Default::default(),
VersionStrategy::Latest(&latest_version.server_version),
)
.await
{
@ -129,8 +128,7 @@ impl LspAdapter for VtslsLspAdapter {
Self::TYPESCRIPT_PACKAGE_NAME,
&container_dir.join(Self::TYPESCRIPT_TSDK_PATH),
&container_dir,
&latest_version.typescript_version,
Default::default(),
VersionStrategy::Latest(&latest_version.typescript_version),
)
.await
{

View file

@ -6,7 +6,7 @@ use language::{
LanguageToolchainStore, LspAdapter, LspAdapterDelegate, language_settings::AllLanguageSettings,
};
use lsp::{LanguageServerBinary, LanguageServerName};
use node_runtime::NodeRuntime;
use node_runtime::{NodeRuntime, VersionStrategy};
use project::{Fs, lsp_store::language_server_settings};
use serde_json::Value;
use settings::{Settings, SettingsLocation};
@ -108,8 +108,7 @@ impl LspAdapter for YamlLspAdapter {
Self::PACKAGE_NAME,
&server_path,
&container_dir,
&version,
Default::default(),
VersionStrategy::Latest(version),
)
.await;