You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a custom OpenAI-compatible provider returns HTTP 403 with a structured error body, GitHub Copilot CLI reports a generic authentication/provider failure instead of displaying the response's error.message and error.code.This is misleading for valid 403 responses that are not authentication failures, such as policy or quota decisions. VS Code's Copilot client renders the same response clearly.
HTTP/1.1 403 ForbiddenContent-Type: application/jsonx-ms-error-code: GroupMonthlyTokenQuotaExceededRetry-After: 86400
{
"error": {
"code": "GroupMonthlyTokenQuotaExceeded",
"type": "insufficient_quota",
"message": "The monthly token allowance for this group has been exceeded for the current calendar month."
}}
Actual behavior
Copilot CLI displays a generic provider authentication/API-key failure, such as:
textAuthentication failed with provider ... Check your COPILOT_PROVIDER_API_KEY, ...
It does not surface the structured error.message or error.code from the 403 response.
Suggested handling
Distinguish policy/quota 403 responses from authentication 403 responses by inspecting the structured error.code and error.type, and render the server-provided message. The Retry-After and standard error-code headers can remain available as supplemental context.
Affected version
1.0.104
Steps to reproduce the behavior
Configure Copilot CLI to use an OpenAI-compatible provider endpoint.
Make the endpoint return the response above from a model request.
Observe the Copilot CLI message.
Expected behavior
For a structured OpenAI-compatible 403 response, Copilot CLI should prefer the server-provided error.message and display the error.code, unless the error code/type actually indicates an authentication failure.
Actual authentication errors such as invalid_api_key should retain the existing authentication guidance.
Additional context
The HTTP status remains intentionally 403; treating this as 429 would be incorrect and could trigger retry loops. A user-agent-specific server workaround would be brittle, so this appears to require client-side presentation logic.
Activity