Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Copilot provider #6468

Open
developerisnow opened this issue Jan 26, 2025 · 4 comments
Open

Add GitHub Copilot provider #6468

developerisnow opened this issue Jan 26, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@developerisnow
Copy link

Main IDEA is GitHub Copilot subscription is excellent and cheap. It can be integrated into Cline, similar to codecompanion.nvim

What problem or use case are you trying to solve?
Developers need access to powerful AI models for coding assistance, but enterprise-grade solutions are often expensive. GitHub Copilot offers access to advanced models (including Claude 3.5 Sonnet) at a very competitive price point ($10/month). Projects like Cline have demonstrated that it's possible to integrate with Copilot's API through VS Code's extension system to provide this functionality in other tools.

Describe the UX of the solution you'd like

  1. Allow users to authenticate with their GitHub Copilot subscription
  2. Integrate Copilot's AI capabilities directly into the All-Hands development environment:
    • Code completion
    • Code explanation
    • Natural language to code conversion
    • AI-assisted problem solving
  3. Maintain the existing All-Hands workflow while enhancing it with Copilot's capabilities

Do you have thoughts on the technical implementation?
Based on successful implementations in other projects:

  1. Leverage VS Code's extension API to connect with Copilot:
  2. Implement similar to how Cline achieved it (Discussion #660)
  3. Key components needed:
    - GitHub OAuth authentication
    - VS Code extension API integration
    - Copilot API wrapper
    - Token management system

Describe alternatives you've considered

  1. Direct OpenAI API integration (more expensive)
  2. Anthropic Claude API (requires separate enterprise contract)
  3. Custom AI solution (requires significant development resources)

GitHub Copilot integration offers the best balance of:

  • Cost-effectiveness ($10/month per user)
  • Access to premium models (Claude 3.5 Sonnet)
  • Enterprise-ready security
  • Proven implementation path

Additional context
Several projects have successfully implemented this integration:

  1. Cline has working implementation
  2. CodeCompanion provides open-source reference
  3. Growing community of developers using this approach

This would provide All-Hands users with enterprise-grade AI capabilities while maintaining reasonable costs and leveraging existing GitHub infrastructure.

@developerisnow developerisnow added the enhancement New feature or request label Jan 26, 2025
@enyst
Copy link
Collaborator

enyst commented Jan 26, 2025

Thank you for the proposal. In the link provided, I don't see that Cline has implemented it, the issue is linked to a PR that has been closed, not merged.

We have seen previously another proposal for a github workaround, but that code was never going to work. The example linked here is better, but it still needs to get a token in a way that feels like getting around the normal use of Copilot?

More importantly, we don't connect to models directly, we use litellm to connect to models. There is an open issue on this: BerriAI/litellm#6564 on litellm repo. I think maybe it's best to focus the discussion there. If litellm finds a possible way, we'll get it implicitly.

@RodolfoCastanheira
Copy link

FWIW last version of Cline added support for GitHub Copilot

Image

@RodolfoCastanheira
Copy link

More importantly, we don't connect to models directly, we use litellm to connect to models.

Besides authentication with Github, the API is 100% openai-like. The difficult is indeed implementing the mechanism for oath with GitHub to get the api token. Cline used some vscode api, so I presume Open Hands would have to use a different approach, maybe like the vim plugins that support copilot.

Anyway, because of the authentication with Github, I don't expect litellm to support it directly (seems out of scope for them). But if you code this authentication and get the token, you could use litellm to talk to the api just like any other openai compatible provider.

@huangmiao0725
Copy link

@openhands-agent do you have some solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants