Add GitHub token environment variable support for Copilot (#31392)

Add support for environment variables as authentication alternatives to
OAuth flow for Copilot. Closes #31172

We can include the token in HTTPS request headers to hopefully resolve
the rate limiting issue in #9483. This change will be part of a separate
PR.

Release Notes:

- Added support for manually providing an OAuth token for GitHub Copilot
Chat by assigning the GH_COPILOT_TOKEN environment variable

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This commit is contained in:
Clauses Kim 2025-06-09 10:39:44 +00:00 committed by GitHub
parent 78fd2685d5
commit 1fe10117b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 11 deletions

View file

@ -863,6 +863,13 @@ impl Render for ConfigurationView {
copilot::initiate_sign_in(window, cx)
})),
)
.child(
Label::new(
format!("You can also assign the {} environment variable and restart Zed.", copilot::copilot_chat::COPILOT_OAUTH_ENV_VAR),
)
.size(LabelSize::Small)
.color(Color::Muted),
)
}
},
None => v_flex().gap_6().child(Label::new(ERROR_LABEL)),