fix: prevent copilot from leaking into model picker via GH_TOKEN - #46427
Closed
Budescu-Eftimie wants to merge 2 commits into
Closed
fix: prevent copilot from leaking into model picker via GH_TOKEN#46427Budescu-Eftimie wants to merge 2 commits into
Budescu-Eftimie wants to merge 2 commits into
Conversation
GH_TOKEN or COPILOT_GITHUB_TOKEN set for gh CLI or from stale Docker env was causing GitHub Copilot to appear in the TUI model picker dropdown even when the user never configured copilot as their provider. Three-layer fix: - providers.py: empty extra_env_vars for github-copilot overlay so the HERMES_OVERLAYS env-var short-circuit doesn't fire - model_switch.py: gate copilot in Section 1 (PROVIDER_REGISTRY path) behind active_provider / model.provider check — not env vars, since the env var IS the leak vector - credential_pool.py: gate _seed_from_singletons behind is_provider_explicitly_configured, mirroring the existing anthropic guard from PR NousResearch#4210
The new explicit-configuration gate in _seed_from_singletons requires copilot to appear configured before auto-seeding. Set active_provider in the test auth store so the pool has entries for auth_remove_command to operate on.
Contributor
✅ Code Review — Verified CleanReviewed: Prevent Copilot from leaking into model picker via GH_TOKEN Checks applied:
Design note: Removing No bugs found. LGTM. |
Contributor
|
Closed as superseded for the reported picker pollution by #60514. Desktop configured-only picker payloads now exclude ambient gh_cli credentials because they are not explicit provider configuration. The lower-level ambient Copilot discovery remains intentional for onboarding/full-universe surfaces, so that broader behavior was not adopted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GH_TOKEN or COPILOT_GITHUB_TOKEN set for gh CLI or from stale Docker
env was causing GitHub Copilot to appear in the TUI model picker dropdown
even when the user never configured copilot as their provider.
Three-layer fix:
HERMES_OVERLAYS env-var short-circuit doesn't fire
behind active_provider / model.provider check — not env vars, since
the env var IS the leak vector
is_provider_explicitly_configured, mirroring the existing anthropic
guard from PR fix: gate Claude Code credentials behind explicit Hermes config in wizard trigger #4210
How to Test
/model, desktop app dropdown, orhermes modelCLI) — GitHub Copilot should NOT appearChecklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping