Copilot CLI floods Windows Credential Manager with copilot-mcp-oauth / copilot-keychain-chunk entries, causing CredWrite error 8 for other apps

Đang mở
#5,591 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, security

Hướng nghiên cứu

Start by tracing how Copilot CLI stores MCP OAuth credentials and keychain chunks in Windows Credential Manager; the issue does not name source files or tests, so locate the credential storage and auth cleanup entry points first. Reproduce the reported accumulation if possible, then inspect how entries are created, updated, and removed. Done means credential entries do not accumulate across auth updates or clearing, and CredWrite failures are handled gracefully.

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

Mô tả

area:authentication area:mcp area:platform-windows

Summary

Copilot CLI accumulated hundreds of entries in Windows Credential Manager and never removed them. The vault reached a state where no application could write a credential. For example, az devops login failed, and so did cmdkey /add from the command line.

Environment

  • Copilot CLI 1.0.116
  • Windows, Entra ID (AzureAD) user account

Symptoms

Unable to use secure credential store in this environment.
(8, 'CredWrite', 'Not enough memory resources are available to process this command')
  • cmdkey /add:x /user:u /pass:abc fails with "Not enough memory resources are available".
  • The error occurs even for 1-character values, and for the SESSION, LOCAL_MACHINE and ENTERPRISE persistence modes.
  • Adding entries through the Credential Manager UI still worked.
  • Event Viewer showed nothing relevant (no Vault, DPAPI or LSA errors).
  • No policy blocks credential storage (DisableDomainCreds = 0).

Evidence

cmdkey /list showed 332 entries. 268 were Copilot's:

  • 135 x *.copilot-mcp-oauth
  • 133 x copilot-keychain-chunk.<n>.<n>.<n>

The other 64 entries were from other applications. The Credentials vault folder held about 120 KB.

Confirmation

I deleted only the 268 Copilot entries. Credential writes worked again immediately, using the same Python keyring WinVaultKeyring call that failed before.

Expected behavior

  • Update or overwrite existing entries instead of creating new ones.
  • Remove entries when an MCP server's auth is cleared or no longer needed.
  • Store tokens more compactly, with fewer chunked entries.
  • Handle CredWrite failures gracefully.

Workaround

cmdkey /list | Select-String 'Target:' | % {($_ -replace '.*Target:\s*','').Trim()} |
  ? { $_ -match 'copilot-mcp-oauth$|copilot-keychain-chunk\.' } | % { cmdkey /delete:$_ }

Then re-authenticate MCP servers.

Open question

It's unclear which limit was hit (entry count, total size, or something else). UI saves still worked while API writes failed.

Ngôn ngữ chính
Python
Star
11.5k
Fork
2k
Merge trung bình
6 giờ 34 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/copilot-cli

Tất cả issue của github/copilot-cli

Issue tương tự

Thêm issue về Python

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.