Agent Mode fails with GitHub Enterprise auth - "thinking" forever / TypeError: terminated
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
**VS Code Version:** 1.128.0 (Stable) / 1.129.0-insider (Insiders)
**OS:** Windows
## Description
Agent Mode in VS Code does not work reliably when using GitHub Enterprise authentication (`github.copilot.advanced.authProvider: "github-enterprise"`).
## Symptoms
- Agent Mode shows "thinking" indefinitely
- In Insiders: Only the "Local" provider (Copilot CLI) works; "Claude" and "Copilot" providers hang
- In Stable: Agent Mode does not work (as there are only "Claude" and "Copilot" as options available)
- Chat mode (non-Agent) works perfectly with the same GHE auth configuration
## Logs (from Copilot Chat log in Stable)
```
TypeError: terminated
Retrying chat request with default fetcher after: terminated: other side closed
CAPI ping successful, proceeding with chat request retry...
ccreq | success | claude-opus-4.6 | 34339ms | [panel/editAgent]
```
## Logs (from Insiders agenthost.log)
```
[AgentHost] GitHub endpoints changed (api=https://api.)
[Copilot] Set CLI env: COPILOT_GH_HOST=
[Copilot] Found 14 models: Auto, Claude Sonnet 5, Claude Sonnet 4.6, ...
[error] TypeError: fetch failed [Claude] Failed to refresh models
```
## Steps to Reproduce
1. Configure `"github.copilot.advanced": {"authProvider": "github-enterprise"}`
2. Configure `"github-enterprise.uri": "https://"`
3. Open Agent Mode (not Chat mode)
4. Select "Claude" or "Copilot" as provider (as there are only "Claude" and "Copilot" as options available)
5. Send a message → hangs on "thinking"
## Expected Behavior
Agent Mode should work with GHE auth the same way Chat mode does.
## Workaround
In VS Code Insiders, the "Local" provider (which uses the separately-authenticated Copilot CLI) works correctly. Chat mode (non-Agent) works in both VS Code Stable and VS Code Insiders.
## Additional Context
- The copilot token is successfully obtained: `copilot token sku: copilot_enterprise_seat_quota`
- All API endpoints are reachable with normal HTTP responses
- Network connectivity is confirmed; issue appears to be in the AgentHost/Agent Mode connection handling specifically
- The "Local" provider in Insiders bypasses this by routing through the Copilot CLI binary which handles auth separately
Contributor guide
Assessment
This issue has not been assessed yet.