Skip to content

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

Open
noonowl wants to merge 1 commit into
fwcd:mainfrom
noonowl:dev/rate_limit
Open

fix: Improve GitHub API rate limit handling with PAT support#169
noonowl wants to merge 1 commit into
fwcd:mainfrom
noonowl:dev/rate_limit

Conversation

@noonowl
Copy link
Copy Markdown

@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