fix(provider): ignore GITHUB_TOKEN when activating github-copilot - #44231
fix(provider): ignore GITHUB_TOKEN when activating github-copilot#44231aniruddhaadak80 wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: I found a potentially related PR: Related PR:
This PR is related because it's addressing the same issue (#44113) from a different angle. PR #44114 appears to focus on enforcing OAuth for GitHub Copilot, while PR #44231 (the current PR) specifically fixes the problem by skipping GITHUB_TOKEN env activation for the github-copilot provider. These are both working to prevent the provider from being incorrectly activated via environment variables when GITHUB_TOKEN is set. |
|
The unit test and typecheck workflows are in action_required state - could a maintainer approve the workflow runs for this first-time contribution? Local verification: the regression test passes (and fails without the fix), full provider suite and typecheck are clean. |
Issue for this PR
Closes #44113
Type of change
What does this PR do?
The models.dev catalog lists
GITHUB_TOKENas an env var forgithub-copilot, so the generic env activation loop treats anyGITHUB_TOKEN(often set for GitHub tooling) as a Copilot credential and loads the provider with source env. That bypasses the Copilot OAuth plugin, model discovery, and endpoint routing, which sends models likegpt-5.6-solto/chat/completionswhere they fail.This skips
github-copilotin the env activation loop so the provider only activates through its OAuth plugin flow. Generic env activation for all other providers is unchanged.How did you verify your code works?
GITHUB_TOKENset,github-copilotno longer appears in loaded providers (bun test test/provider/provider.test.ts -t GITHUB_TOKENpasses; it fails without the fix).bun run typecheckand the fulltest/provider/provider.test.tssuite locally.Screenshots / recordings
Not a UI change.
Checklist