fix(copilot): support GitHub Enterprise endpoints - #78378
Conversation
Route OAuth, token exchange, model discovery, inference, refresh, and auxiliary clients through configured or exchange-discovered enterprise endpoints while preserving public GitHub defaults. Builds on the enterprise support proposed by @HearthCore in NousResearch#6468. Refs NousResearch#11442 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This is valuable — enterprise-endpoint support has been a real gap. One data point from running a plan-scoped (business) account that might help harden the resolver: The token-exchange discovery path ( Suggestion: try the exchange first (your current path, correct for enterprise-exchange accounts), then fall back to |
Summary
COPILOT_GH_HOST.Closes #11442.
Prior work
This builds on the GitHub Enterprise support proposed by @HearthCore in #6468 and adapts it to the current provider, credential-pool, model-catalog, Responses API, and auxiliary-client architecture.
Configuration
COPILOT_GH_HOSTcontrols OAuth,gh auth token --hostname, and token exchange.COPILOT_API_BASE_URLis authoritative for inference and model-catalog routing. When unset, token-exchange endpoint metadata is used before the public fallback.Test plan
Risk assessment
Low. Public GitHub URLs remain the defaults when enterprise variables are unset. Endpoint matching uses parsed hostnames rather than substring matching, and catalog caches include endpoint identity to avoid cross-account reuse.