Skip to content

feat: Add GitHub Copilot provider support#178

Merged
mengzhuo merged 10 commits intosipeed:mainfrom
Lixeer:main
Feb 15, 2026
Merged

feat: Add GitHub Copilot provider support#178
mengzhuo merged 10 commits intosipeed:mainfrom
Lixeer:main

Conversation

@Lixeer
Copy link
Contributor

@Lixeer Lixeer commented Feb 14, 2026

As feature reaquest #98

What pull reaquest finsh

  • Add support. if you want to use ,you must download Copilot CLI and use command copilot --headless --port 4321 . link for details
  • Only for grpc mode. I will finsh stdio one as soon as possible.
  • Because of the SDK framwork(you can learn more about it), I order to implement the fullcontent ungracefully ungraceful

preview

func (p *GitHubCopilotProvider) Chat(ctx context.Context, messages []Message, tools []ToolDefinition, model string, options map[string]interface{}) (*LLMResponse, error) {
    type tempMessage struct {
        Role       string `json:"role"`
        Content    string `json:"content"`
    }
    out := make([]tempMessage, 0, len(messages))

    for _, msg := range messages {
        out = append(out, tempMessage{
            Role:       msg.Role,
            Content:    msg.Content,
        })
    }  

    fullcontent,_ := json.Marshal(out)
    // must join strings
    content,_ := p.session.Send(ctx,copilot.MessageOptions{
        Prompt: string(fullcontent),   
    })
     
    return &LLMResponse{
        FinishReason : "stop",
        Content:  content,
    }, nil
    
}

Finally:

  • I found some problem with the current design, such as
    pkg/http_provider.go
func CreateProvider(cfg *config.Config) (LLMProvider, error) {
      //......
}

This a factory function for provider building. including, but not limited toHTTPProvider

config/config.go

type ProvidersConfig struct {
	Anthropic    ProviderConfig `json:"anthropic"`
	OpenAI       ProviderConfig `json:"openai"`
	OpenRouter   ProviderConfig `json:"openrouter"`
	Groq         ProviderConfig `json:"groq"`
	Zhipu        ProviderConfig `json:"zhipu"`
	VLLM         ProviderConfig `json:"vllm"`
	Gemini       ProviderConfig `json:"gemini"`
	Nvidia       ProviderConfig `json:"nvidia"`
	Moonshot     ProviderConfig `json:"moonshot"`
	ShengSuanYun ProviderConfig `json:"shengsuanyun"`
	DeepSeek     ProviderConfig `json:"deepseek"`
	GitHubCopilot ProviderConfig `json:"github_copilot"`
}

All of provider using same struct. The api_key,api_base just suit for http . We need to consider grpc ,stdio, pipline

@Lixeer Lixeer force-pushed the main branch 2 times, most recently from 89ebc3d to 0a4bf32 Compare February 15, 2026 00:01
@mengzhuo mengzhuo merged commit 6f2e730 into sipeed:main Feb 15, 2026
3 checks passed
@mengzhuo
Copy link
Collaborator

Thanks, please submit example config and update document.

emadomedher pushed a commit to emadomedher/picoclaw that referenced this pull request Feb 17, 2026
feat: Add `GitHub Copilot` provider support
StarWindv referenced this pull request in StarWindv/PicoClaw-shou Feb 19, 2026
feat: Add `GitHub Copilot` provider support
@Orgmar
Copy link
Contributor

Orgmar commented Feb 19, 2026

@Lixeer GitHub Copilot provider的支持很赞!通过grpc模式对接Copilot CLI的方案挺巧妙的,给用户多了一个provider选择。

我们正在组建 PicoClaw Dev Group,在Discord上方便贡献者交流和协作。如果你有兴趣,发邮件到 [email protected],主题写 [Join PicoClaw Dev Group] + 你的GitHub账号,我们会把邀请链接发给你!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants