fix(copilot): gh copilot auth token conflicts w/ gh mcp env var (#2743)

This commit is contained in:
GitMurf
2025-06-04 12:46:27 -07:00
committed by GitHub
parent 176ab18880
commit 465a43cf51
+2 -2
View File
@@ -230,7 +230,7 @@ impl GithubCopilotProvider {
async fn refresh_api_info(&self) -> Result<CopilotTokenInfo> { async fn refresh_api_info(&self) -> Result<CopilotTokenInfo> {
let config = Config::global(); let config = Config::global();
let token = match config.get_secret::<String>("GITHUB_TOKEN") { let token = match config.get_secret::<String>("GITHUB_COPILOT_TOKEN") {
Ok(token) => token, Ok(token) => token,
Err(err) => match err { Err(err) => match err {
ConfigError::NotFound(_) => { ConfigError::NotFound(_) => {
@@ -238,7 +238,7 @@ impl GithubCopilotProvider {
.get_access_token() .get_access_token()
.await .await
.context("unable to login into github")?; .context("unable to login into github")?;
config.set_secret("GITHUB_TOKEN", Value::String(token.clone()))?; config.set_secret("GITHUB_COPILOT_TOKEN", Value::String(token.clone()))?;
token token
} }
_ => return Err(err.into()), _ => return Err(err.into()),