Repository navigation
Backlog
Backlog
Windows: stale copilot-keychain-chunk credentials accumulate and can exhaust Credential Manager#5473
Bug
Copy link
Labels
area:authenticationLogin, OAuth, device auth, token management, and keychain integrationLogin, OAuth, device auth, token management, and keychain integrationarea:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows TerminalWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminal
Description
Summary
On Windows, copilot-keychain-chunk.* entries appear to accumulate in Windows Credential Manager without being cleaned up. Once the per-user vault is full, every application on the machine fails to store credentials, which broke an unrelated tool's login.
Observed
- Windows Credential Manager contained ~180
copilot-keychain-chunk.<hash>.<uuid>.<n>generic credentials (about two thirds of all entries in the vault). CredWritefrom an unrelated process failed with Win32 error 8 (ERROR_NOT_ENOUGH_MEMORY, "Not enough memory resources are available to process this command") even for a ~1 KB blob. Free RAM was not an issue.- An unrelated CLI that stores its OAuth token in Credential Manager then failed with an error mentioning "OS keyring is not reachable ... Not enough memory resources".
- After deleting all
copilot-keychain-chunk.*entries (vault went from 265 to 83 entries), writes succeeded again.
Suspected cause (inference, not confirmed)
Secrets are split into chunks, and when a secret is rewritten or refreshed (for example MCP OAuth tokens), the previous chunk set is not deleted. Failed or interrupted writes may also strand chunks. The middle UUID segment looks like a per-write version id.
Suggested fix
- On write: write the new chunks, update the index or pointer, then delete the old chunk set only after success.
- On startup: sweep and delete any
copilot-keychain-chunk.*entry not referenced by a current index. - Surface a clear warning when a credential write fails with a resource or quota error (related: Windows credential-storage failures need operation-level diagnostics and an accurate warning #5399).
Environment
- Windows 11
- Multiple MCP servers configured (several using OAuth)
- Not sure whether the writer is the CLI or the desktop app; both may share this storage code. Please re-label or transfer if this is the wrong repo.
Metadata
Metadata
Assignees
Labels
area:authenticationLogin, OAuth, device auth, token management, and keychain integrationLogin, OAuth, device auth, token management, and keychain integrationarea:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows TerminalWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminal
Activity