Skip to content

fix: Improve GitHub API rate limit handling with PAT support #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

noonowl
Copy link

@noonowl noonowl commented Mar 26, 2025

Description

This PR improves the GitHub API rate limit handling in the Kotlin Language Server extension by adding proper Personal Access Token (PAT) support.

Changes

  • Fix GitHub API authentication header format to use Authorization: Bearer <token>
  • Add conditional token header addition
  • Add helpful warning message when rate limit is exceeded without a token

Why

GitHub's API has rate limits for unauthenticated requests. When users hit these limits, they get 403 errors. By supporting Personal Access Tokens (PATs), users can increase their rate limits and avoid these errors.

How to use

  1. Create a GitHub Personal Access Token with repo scope
  2. Set the token as an environment variable:
    # macOS/Linux
    export GITHUB_TOKEN=your_token_here
    
    # Windows (PowerShell)
    $env:GITHUB_TOKEN="your_token_here"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Related to the VSCode extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants