opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(tui): enable GitHub Copilot Enterprise authentication in /connect…

Open Raviguntakala opened this issue 1 week ago • 2 comments

Problem

GitHub Copilot Enterprise authentication is missing in TUI /connect command. The CLI (auth login) supports enterprise login with deployment type selection and conditional prompts, but TUI /connect has no option for enterprise authentication at all.

Solution

Added enterprise authentication support to TUI /connect by implementing the same prompt collection logic as CLI:

  • Added prompt collection loop to gather user inputs (deployment type, enterprise URL, etc.)
  • Implemented conditional prompt logic for enterprise-specific fields
  • OAuth callback now returns actual provider ID (github-copilot-enterprise vs github-copilot)

Changes

  • dialog-provider.tsx - Added prompt collection before authorization
  • auth.ts, server.ts - Return actual provider ID from OAuth callback
  • dialog-model.tsx - Filter by provider.id instead of model.providerID
  • provider.ts - Check both regular and enterprise auth for github-copilot plugin

Testing

  • /connect with GitHub Copilot (public)
  • /connect with GitHub Copilot Enterprise
  • ✅ Enterprise models display correctly

Note: If these changes are approved, I will raise a separate PR for Desktop app support.

Before :

https://github.com/user-attachments/assets/b7c35429-771e-4443-ae0e-db90160cc12d

After :

https://github.com/user-attachments/assets/88673ad8-4bf1-4485-8fcf-9f8512ba1e72

Raviguntakala avatar Jan 05 '26 17:01 Raviguntakala