github / github/copilot-sdk

[Question / Potential bug] Inconsistent models listing with Microsoft Agent Framework (.NET) + Copilot SDK

Đang mở
#1,075 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
Java
Star
10.5k
Fork
1.5k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
128

Mô tả

Hi,

I've added an integration with Microsoft Agent Framework (.NET) inside a WinForms application and I've experienced inconsistent listing of CopilotClient models using the ```ListModelsAsync``` function.

### Context
I'm using a GH user that was invited to a GH organization which got assigned a Copilot seat. I have a suspicion that the models (1 model only: gpt-4.1) returned are from my regular GH user which has no Copilot seat/license assigned to it.

### OS
Windows

### NuGet Packages

- Microsoft.Agents.AI (1.0.0)
- Microsoft.Agents.AI.GitHub.Copilot (1.0.0-preview.260402.1)
- GitHub.Copilot.SDK (0.2.1)

### How I achieve getting wrong list of models

1. Start and complete the Auth Device Flow with GH using the GH Copilot public client ID to obtain a GH token
2. Store the valid GH token
3. Create a ```CopilotClient``` with ```CopilotClientOptions``` (GithubToken, ```UseLoggedInUser = false```) and start it.
4. Obtain the list of models by calling ```await client.ListModelsAsync()```
5. Only ```gpt-4.1``` is returned, expected the same models available through VS Code.

### Questions
- Am I using the correct auth flow to get the proper GH token which has access to the Copilot seat assigned from my organization?
- Is there ways to call an HTTP endpoint in order to get the list of models instead of instanciating a CopilotClient. I have seen that VS Code codebase calls ```https://api.github.com/copilot_internal/*``` endpoints which I've read would be against ToS to call.

### Maybe a bug maybe not...
A colleague found an interesting route that could maybe explain the 1 model returned. When the CLI gets launched with ```--no-auto-update``` it picks up an old version in his ```C:/users/[username]/.copilot\pkg\win32-x64\0.0.403```. When the parameter ```--no-auto-update``` isn't there it picks up this version ```C:\Users\[username]\.copilot\pkg\universal\1.0.14```. He tested it manually by launching the CLI from the bundled ```copilot.exe``` inside our WinForm app with PowerShell and he was able to reproduce the same error which resulted in only getting 1 model (gpt-4.1) returned.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với việc thiết lập CopilotClientOptions, Auth Device Flow và lời gọi ListModelsAsync được mô tả trong issue. Tái hiện kết quả bằng các gói NuGet được liệt kê và so sánh các bản build CLI 0.0.403 và 1.0.14. Hoàn thành có nghĩa là xác định liệu token hay phiên bản CLI giải thích cho sự khác biệt trong danh sách model, đồng thời ghi lại hành vi ожида đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp
Lĩnh vực
api, authentication, developer-experience
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.